[polly] r271511 - Bail early for complex alias checks

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 2 04:06:57 PDT 2016


Author: jdoerfert
Date: Thu Jun  2 06:06:54 2016
New Revision: 271511

URL: http://llvm.org/viewvc/llvm-project?rev=271511&view=rev
Log:
Bail early for complex alias checks

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

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=271511&r1=271510&r2=271511&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Thu Jun  2 06:06:54 2016
@@ -2020,7 +2020,7 @@ public:
   }
 
   /// @brief Build the alias checks for this SCoP.
-  void buildAliasChecks(AliasAnalysis &AA);
+  bool buildAliasChecks(AliasAnalysis &AA);
 
   /// @brief Build all alias groups for this SCoP.
   ///

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=271511&r1=271510&r2=271511&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Thu Jun  2 06:06:54 2016
@@ -95,6 +95,7 @@ static cl::opt<unsigned> RunTimeChecksMa
     "polly-rtc-max-arrays-per-group",
     cl::desc("The maximal number of arrays to compare in each alias group."),
     cl::Hidden, cl::ZeroOrMore, cl::init(20), cl::cat(PollyCategory));
+
 static cl::opt<std::string> UserContextStr(
     "polly-context", cl::value_desc("isl parameter set"),
     cl::desc("Provide additional constraints on the context parameters"),
@@ -2867,12 +2868,12 @@ bool Scop::hasNonHoistableBasePtrInScop(
   return false;
 }
 
-void Scop::buildAliasChecks(AliasAnalysis &AA) {
+bool Scop::buildAliasChecks(AliasAnalysis &AA) {
   if (!PollyUseRuntimeAliasChecks)
-    return;
+    return true;
 
   if (buildAliasGroups(AA))
-    return;
+    return true;
 
   // If a problem occurs while building the alias groups we need to delete
   // this SCoP and pretend it wasn't valid in the first place. To this end
@@ -2885,6 +2886,7 @@ void Scop::buildAliasChecks(AliasAnalysi
                   "dismissed.\nUse:\n\t--polly-rtc-max-parameters=X\nto adjust "
                   "the maximal number of parameters but be advised that the "
                   "compile time might increase exponentially.\n\n");
+  return false;
 }
 
 bool Scop::buildAliasGroups(AliasAnalysis &AA) {
@@ -3048,7 +3050,7 @@ bool Scop::buildAliasGroups(AliasAnalysi
     // Bail out if the number of values we need to compare is too large.
     // This is important as the number of comparisions grows quadratically with
     // the number of values we need to compare.
-    if (!Valid || (MinMaxAccessesNonReadOnly.size() + !ReadOnlyPairs.empty() >
+    if (!Valid || (MinMaxAccessesNonReadOnly.size() + ReadOnlyPairs.size() >
                    RunTimeChecksMaxArraysPerGroup))
       return false;
 
@@ -3140,7 +3142,8 @@ void Scop::init(AliasAnalysis &AA, Assum
   addRecordedAssumptions();
 
   simplifyContexts();
-  buildAliasChecks(AA);
+  if (!buildAliasChecks(AA))
+    return;
 
   hoistInvariantLoads();
   verifyInvariantLoads();




More information about the llvm-commits mailing list