Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kruse <llvm-project@meinersbur.de>2021-08-18 20:22:21 +0300
committerMichael Kruse <llvm-project@meinersbur.de>2021-08-18 20:41:04 +0300
commite8c8407aca7c6c5778cb969fef89ffaa212d6de5 (patch)
tree981bf0fd7be0df6145863e3a32d5676a53ebdc1e /polly/lib/Support
parent20e62658735a1b03ecadc3072593753abca21fd0 (diff)
[Polly] Break early when the result is known. NFC.
Diffstat (limited to 'polly/lib/Support')
-rw-r--r--polly/lib/Support/ScopHelper.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/polly/lib/Support/ScopHelper.cpp b/polly/lib/Support/ScopHelper.cpp
index efb3b9afa698..5d29fe8b7a22 100644
--- a/polly/lib/Support/ScopHelper.cpp
+++ b/polly/lib/Support/ScopHelper.cpp
@@ -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)