Fix uninitialized use of the Changed variable.
[oota-llvm.git] / lib / Transforms / Scalar / LoopStrengthReduce.cpp
index ccb25f05a6442e681f913b4945f05e65b70c9dea..5bbc8322bc67c48ea969ddc503d2f543badab4df 100644 (file)
@@ -1747,6 +1747,7 @@ bool LoopStrengthReduce::runOnLoop(Loop *L, LPPassManager &LPM) {
   SE = &getAnalysis<ScalarEvolution>();
   TD = &getAnalysis<TargetData>();
   UIntPtrTy = TD->getIntPtrType();
+  Changed = false;
 
   // Find all uses of induction variables in this loop, and catagorize
   // them by stride.  Start by finding all of the PHI nodes in the header for
@@ -1831,6 +1832,7 @@ bool LoopStrengthReduce::runOnLoop(Loop *L, LPPassManager &LPM) {
             SE->deleteValueFromRecords(PN);
             PN->replaceAllUsesWith(UndefValue::get(PN->getType()));
             DeadInsts.insert(PN);
+            Changed = true;
             break;
           }
         }