[polly] r255430 - ScopInfo: Add helper function to invalidate a scop

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 12 01:52:27 PST 2015


Author: grosser
Date: Sat Dec 12 03:52:26 2015
New Revision: 255430

URL: http://llvm.org/viewvc/llvm-project?rev=255430&view=rev
Log:
ScopInfo: Add helper function to invalidate a scop

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=255430&r1=255429&r2=255430&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Sat Dec 12 03:52:26 2015
@@ -1534,6 +1534,17 @@ public:
   void addAssumption(AssumptionKind Kind, __isl_take isl_set *Set,
                      DebugLoc Loc);
 
+  /// @brief Mark the scop as invalid.
+  ///
+  /// This method adds an assumption to the scop that is always invalid. As a
+  /// result, the scop will not be optimized later on. This function is commonly
+  /// called when a condition makes it impossible (or too compile time
+  /// expensive) to process this scop any further.
+  ///
+  /// @param Kind The assumption kind describing the underlying cause.
+  /// @param Loc  The location in the source that triggered .
+  void invalidate(AssumptionKind Kind, DebugLoc Loc);
+
   /// @brief Get the boundary context for this Scop.
   ///
   /// @return The boundary context of this Scop.

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=255430&r1=255429&r2=255430&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sat Dec 12 03:52:26 2015
@@ -674,8 +674,7 @@ void MemoryAccess::buildAccessRelation(c
       Affine = isl_pw_aff_scale_down_val(Affine, v);
 
       if (!isDivisible(Subscripts[0], getElemSizeInBytes(), *S.getSE()))
-        S.addAssumption(ALIGNMENT, isl_set_empty(S.getParamSpace()),
-                        AccessInstruction->getDebugLoc());
+        S.invalidate(ALIGNMENT, AccessInstruction->getDebugLoc());
     }
 
     isl_map *SubscriptMap = isl_map_from_pw_aff(Affine);
@@ -2426,7 +2425,7 @@ void Scop::buildAliasChecks(AliasAnalysi
   // 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
   // we make the assumed context infeasible.
-  addAssumption(ALIASING, isl_set_empty(getParamSpace()), DebugLoc());
+  invalidate(ALIASING, DebugLoc());
 
   DEBUG(dbgs() << "\n\nNOTE: Run time checks for " << getNameStr()
                << " could not be created as the number of parameters involved "
@@ -2949,8 +2948,7 @@ void Scop::hoistInvariantLoads() {
                    << ") is required to be invariant but was not marked as "
                       "such. SCoP for "
                    << getRegion() << " will be dropped\n\n");
-      addAssumption(INVARIANTLOAD, isl_set_empty(getParamSpace()),
-                    LI->getDebugLoc());
+      invalidate(INVARIANTLOAD, LI->getDebugLoc());
       return;
     }
   }
@@ -2969,8 +2967,7 @@ Scop::getOrCreateScopArrayInfo(Value *Ba
     // In case of mismatching array sizes, we bail out by setting the run-time
     // context to false.
     if (!SAI->updateSizes(Sizes))
-      addAssumption(DELINEARIZATION, isl_set_empty(getParamSpace()),
-                    DebugLoc());
+      invalidate(DELINEARIZATION, DebugLoc());
   }
   return SAI.get();
 }
@@ -3082,6 +3079,10 @@ void Scop::addAssumption(AssumptionKind
   AssumedContext = isl_set_coalesce(AssumedContext);
 }
 
+void Scop::invalidate(AssumptionKind Kind, DebugLoc Loc) {
+  addAssumption(Kind, isl_set_empty(getParamSpace()), Loc);
+}
+
 __isl_give isl_set *Scop::getBoundaryContext() const {
   return isl_set_copy(BoundaryContext);
 }




More information about the llvm-commits mailing list