From: Johannes Doerfert Date: Thu, 1 Dec 2016 11:12:14 +0000 (+0000) Subject: [NFC] Check for feasibility prior to the profitability check X-Git-Tag: llvmorg-4.0.0-rc1~3287 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1d6608430906ca9ca1977ab51f73dbe6cad7f90;p=platform%2Fupstream%2Fllvm.git [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 @@ void Scop::init(AliasAnalysis &AA, AssumptionCache &AC, DominatorTree &DT, 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, AssumptionCache &AC, DominatorTree &DT, // 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;