Exit a search loop when the search goal is found.
authorDan Gohman <gohman@apple.com>
Mon, 26 Jul 2010 17:41:45 +0000 (17:41 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 26 Jul 2010 17:41:45 +0000 (17:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109404 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Dominators.cpp

index 96add57f14641ebd32c004802d22a2b6a533f4a5..8a33eb06236a5bab767459307d3187b1cc0fb3fd 100644 (file)
@@ -161,8 +161,10 @@ void DominanceFrontier::splitBlock(BasicBlock *NewBB) {
         bool DominatesPred = false;
         for (pred_iterator PI = pred_begin(*SetI), E = pred_end(*SetI);
              PI != E; ++PI)
-          if (DT.dominates(NewBB, *PI))
+          if (DT.dominates(NewBB, *PI)) {
             DominatesPred = true;
+            break;
+          }
         if (!DominatesPred)
           Set.erase(SetI++);
         else