[polly] r256140 - ScopInfo: Return immediately if scop is unprofitable and marked invalid

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 01:09:44 PST 2015


Author: grosser
Date: Mon Dec 21 03:09:44 2015
New Revision: 256140

URL: http://llvm.org/viewvc/llvm-project?rev=256140&view=rev
Log:
ScopInfo: Return immediately if scop is unprofitable and marked invalid

As we already log an error when calling invalid, scops unprofitable scops are in
any case marked invalid, but returning immediately safes (a tiny bit of) compile
time and is consistent with our use of 'invalid' in the remainder of the file.

Found by inspection.

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

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=256140&r1=256139&r2=256140&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Mon Dec 21 03:09:44 2015
@@ -1160,7 +1160,7 @@ bool ScopDetection::isValidRegion(Detect
 
   int NumLoops = countBeneficialLoops(&CurRegion);
   if (!PollyProcessUnprofitable && NumLoops < 2)
-    invalid<ReportUnprofitable>(Context, /*Assert=*/true, &CurRegion);
+    return invalid<ReportUnprofitable>(Context, /*Assert=*/true, &CurRegion);
 
   if (!allBlocksValid(Context))
     return false;
@@ -1168,12 +1168,12 @@ bool ScopDetection::isValidRegion(Detect
   // We can probably not do a lot on scops that only write or only read
   // data.
   if (!PollyProcessUnprofitable && (!Context.hasStores || !Context.hasLoads))
-    invalid<ReportUnprofitable>(Context, /*Assert=*/true, &CurRegion);
+    return invalid<ReportUnprofitable>(Context, /*Assert=*/true, &CurRegion);
 
   // Check if there are sufficent non-overapproximated loops.
   int NumAffineLoops = NumLoops - Context.BoxedLoopsSet.size();
   if (!PollyProcessUnprofitable && NumAffineLoops < 2)
-    invalid<ReportUnprofitable>(Context, /*Assert=*/true, &CurRegion);
+    return invalid<ReportUnprofitable>(Context, /*Assert=*/true, &CurRegion);
 
   DEBUG(dbgs() << "OK\n");
   return true;




More information about the llvm-commits mailing list