[polly] r288329 - [NFC] Check for feasibility prior to the profitability check

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 03:12:15 PST 2016


Author: jdoerfert
Date: Thu Dec  1 05:12:14 2016
New Revision: 288329

URL: http://llvm.org/viewvc/llvm-project?rev=288329&view=rev
Log:
[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.

Modified:
    polly/trunk/lib/Analysis/ScopInfo.cpp

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=288329&r1=288328&r2=288329&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Thu Dec  1 05:12:14 2016
@@ -3109,6 +3109,10 @@ void Scop::init(AliasAnalysis &AA, Assum
   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 @@ void Scop::init(AliasAnalysis &AA, Assum
 
   // 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 @@ bool Scop::isProfitable() const {
   if (PollyProcessUnprofitable)
     return true;
 
-  if (!hasFeasibleRuntimeContext())
-    return false;
-
   if (isEmpty())
     return false;
 




More information about the llvm-commits mailing list