diff options
-rw-r--r-- | lib/Transforms/Scalar/LoopIndexSplit.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp index 37adeef..1d110e1 100644 --- a/lib/Transforms/Scalar/LoopIndexSplit.cpp +++ b/lib/Transforms/Scalar/LoopIndexSplit.cpp @@ -65,6 +65,15 @@ namespace { // Loop exit condition. ICmpInst *ExitCondition; + + // Clear split info. + void clear() { + IndVar = NULL; + SplitValue = NULL; + ExitValue = NULL; + SplitCondition = NULL; + ExitCondition = NULL; + } }; private: @@ -193,6 +202,8 @@ void LoopIndexSplit::findSplitCondition() { if (SD.SplitCondition) { SD.IndVar = PN; SplitData.push_back(SD); + // Before reusing SD for next split condition clear its content. + SD.clear(); } } } |