[Polly] Break early when the result is known. NFC.
This commit is contained in:
parent
20e6265873
commit
e8c8407aca
|
@ -428,13 +428,19 @@ bool polly::isErrorBlock(BasicBlock &BB, const Region &R, LoopInfo &LI,
|
|||
// as their execution can not be a rare event.
|
||||
bool DominatesAllPredecessors = true;
|
||||
if (R.isTopLevelRegion()) {
|
||||
for (BasicBlock &I : *R.getEntry()->getParent())
|
||||
if (isa<ReturnInst>(I.getTerminator()) && !DT.dominates(&BB, &I))
|
||||
for (BasicBlock &I : *R.getEntry()->getParent()) {
|
||||
if (isa<ReturnInst>(I.getTerminator()) && !DT.dominates(&BB, &I)) {
|
||||
DominatesAllPredecessors = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (auto Pred : predecessors(R.getExit()))
|
||||
if (R.contains(Pred) && !DT.dominates(&BB, Pred))
|
||||
for (auto Pred : predecessors(R.getExit())) {
|
||||
if (R.contains(Pred) && !DT.dominates(&BB, Pred)) {
|
||||
DominatesAllPredecessors = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (DominatesAllPredecessors)
|
||||
|
|
Loading…
Reference in a new issue