[NFC] Check for feasibility prior to the profitability check
Feasibility is checked late on its own but early it is hidden behind
the "PollyProcessUnprofitable" guard. This change will make sure we opt
out early if the runtime context is infeasible anyway.
llvm-svn: 288329
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 9b15a1d..a8d64d8 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -3109,6 +3109,10 @@
for (ScopStmt &Stmt : Stmts)
Stmt.init(LI);
+ // Check early for a feasible runtime context.
+ if (!hasFeasibleRuntimeContext())
+ return;
+
// Check early for profitability. Afterwards it cannot change anymore,
// only the runtime context could become infeasible.
if (!isProfitable()) {
@@ -3137,10 +3141,8 @@
// Check late for a feasible runtime context because profitability did not
// change.
- if (!hasFeasibleRuntimeContext()) {
- invalidate(PROFITABLE, DebugLoc());
+ if (!hasFeasibleRuntimeContext())
return;
- }
}
Scop::~Scop() {
@@ -3612,9 +3614,6 @@
if (PollyProcessUnprofitable)
return true;
- if (!hasFeasibleRuntimeContext())
- return false;
-
if (isEmpty())
return false;