[JumpThreading] Don't forget to report that the IR changed
[oota-llvm.git] / lib / Transforms / Scalar / JumpThreading.cpp
index 35a10db329238bdbacde808938cb60f2f0dc4f09..dcdcfed66e6413588443527a3b2fffe3d06cc7da 100644 (file)
@@ -211,11 +211,12 @@ bool JumpThreading::runOnFunction(Function &F) {
   // we will loop forever. We take care of this issue by not jump threading for
   // back edges. This works for normal cases but not for unreachable blocks as
   // they may have cycle with no back edge.
-  removeUnreachableBlocks(F);
+  bool EverChanged = false;
+  EverChanged |= removeUnreachableBlocks(F, LVI);
 
   FindLoopHeaders(F);
 
-  bool Changed, EverChanged = false;
+  bool Changed;
   do {
     Changed = false;
     for (Function::iterator I = F.begin(), E = F.end(); I != E;) {