[polly] r306087 - Hoist buildMinMaxAccess computeout to cover full alias-group

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 01:05:27 PDT 2017


Author: grosser
Date: Fri Jun 23 03:05:27 2017
New Revision: 306087

URL: http://llvm.org/viewvc/llvm-project?rev=306087&view=rev
Log:
Hoist buildMinMaxAccess computeout to cover full alias-group

This allows us to bail out both in case the lexmin/max computation is too
expensive, but also in case the commulative cost across an alias group is
too expensive. This is an improvement of r303404, which did not seem to
be sufficient to keep the Android Buildbot quiet.

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=306087&r1=306086&r2=306087&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Fri Jun 23 03:05:27 2017
@@ -98,7 +98,7 @@ static cl::opt<int>
     OptComputeOut("polly-analysis-computeout",
                   cl::desc("Bound the scop analysis by a maximal amount of "
                            "computational steps (0 means no bound)"),
-                  cl::Hidden, cl::init(600000), cl::ZeroOrMore,
+                  cl::Hidden, cl::init(800000), cl::ZeroOrMore,
                   cl::cat(PollyCategory));
 
 static cl::opt<bool> PollyRemarksMinimal(
@@ -2447,16 +2447,11 @@ buildMinMaxAccess(isl::set Set, Scop::Mi
       return isl::stat::error;
   }
 
-  {
-    IslMaxOperationsGuard MaxOpGuard(Ctx.get(), OptComputeOut);
-    MinPMA = Set.lexmin_pw_multi_aff();
-    MaxPMA = Set.lexmax_pw_multi_aff();
-  }
+  MinPMA = Set.lexmin_pw_multi_aff();
+  MaxPMA = Set.lexmax_pw_multi_aff();
 
-  if (isl_ctx_last_error(Ctx.get()) == isl_error_quota) {
-    S.invalidate(COMPLEXITY, DebugLoc());
+  if (isl_ctx_last_error(Ctx.get()) == isl_error_quota)
     return isl::stat::error;
-  }
 
   MinPMA = MinPMA.coalesce();
   MaxPMA = MaxPMA.coalesce();
@@ -2500,7 +2495,6 @@ static bool calculateMinMaxAccess(Scop::
   isl::union_set Locations = Accesses.range();
   Locations = Locations.coalesce();
   Locations = Locations.detect_equalities();
-  ;
 
   auto Lambda = [&MinMaxAccesses, &S](isl::set Set) -> isl::stat {
     return buildMinMaxAccess(Set, MinMaxAccesses, S);
@@ -3332,9 +3326,16 @@ bool Scop::buildAliasGroups(AliasAnalysi
   splitAliasGroupsByDomain(AliasGroups);
 
   for (AliasGroupTy &AG : AliasGroups) {
-    bool Valid = buildAliasGroup(AG, HasWriteAccess);
-    if (!Valid)
+    {
+      IslMaxOperationsGuard MaxOpGuard(getIslCtx(), OptComputeOut);
+      bool Valid = buildAliasGroup(AG, HasWriteAccess);
+      if (!Valid)
+        return false;
+    }
+    if (isl_ctx_last_error(getIslCtx()) == isl_error_quota) {
+      invalidate(COMPLEXITY, DebugLoc());
       return false;
+    }
   }
 
   return true;




More information about the llvm-commits mailing list