[polly] e8c8407 - [Polly] Break early when the result is known. NFC.
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 18 10:41:17 PDT 2021
Author: Michael Kruse
Date: 2021-08-18T12:41:04-05:00
New Revision: e8c8407aca7c6c5778cb969fef89ffaa212d6de5
URL: https://github.com/llvm/llvm-project/commit/e8c8407aca7c6c5778cb969fef89ffaa212d6de5
DIFF: https://github.com/llvm/llvm-project/commit/e8c8407aca7c6c5778cb969fef89ffaa212d6de5.diff
LOG: [Polly] Break early when the result is known. NFC.
Added:
Modified:
polly/lib/Support/ScopHelper.cpp
Removed:
################################################################################
diff --git a/polly/lib/Support/ScopHelper.cpp b/polly/lib/Support/ScopHelper.cpp
index efb3b9afa6980..5d29fe8b7a223 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)
More information about the llvm-commits
mailing list