From 9021c7001eeb755f7109906db1deb49de9d09708 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 8 Aug 2007 21:18:27 +0000 Subject: [PATCH] Clear split info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40944 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopIndexSplit.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp index 37adeeff337..1d110e17438 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(); } } }