Exit a search loop when the search goal is found.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109404 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2010-07-26 17:41:45 +00:00
parent 1deeaa6467
commit e96a6fe351

View 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