[polly] r271890 - [NFC] Refactor assumption tracking interface

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 05:16:13 PDT 2016


Author: jdoerfert
Date: Mon Jun  6 07:16:10 2016
New Revision: 271890

URL: http://llvm.org/viewvc/llvm-project?rev=271890&view=rev
Log:
[NFC] Refactor assumption tracking interface

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=271890&r1=271889&r2=271890&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Mon Jun  6 07:16:10 2016
@@ -1942,6 +1942,15 @@ public:
   /// @returns True if the optimized SCoP can be executed.
   bool hasFeasibleRuntimeContext() const;
 
+  /// @brief Check if the assumption in @p Set is trivial or not.
+  ///
+  /// @param Set  The relations between parameters that are assumed to hold.
+  /// @param Sign Enum to indicate if the assumptions in @p Set are positive
+  ///             (needed/assumptions) or negative (invalid/restrictions).
+  ///
+  /// @returns True if the assumption @p Set is not trivial.
+  bool isEffectiveAssumption(__isl_keep isl_set *Set, AssumptionSign Sign);
+
   /// @brief Track and report an assumption.
   ///
   /// Use 'clang -Rpass-analysis=polly-scops' or 'opt

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=271890&r1=271889&r2=271890&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Mon Jun  6 07:16:10 2016
@@ -3678,23 +3678,27 @@ static std::string toString(AssumptionKi
   llvm_unreachable("Unknown AssumptionKind!");
 }
 
-bool Scop::trackAssumption(AssumptionKind Kind, __isl_keep isl_set *Set,
-                           DebugLoc Loc, AssumptionSign Sign) {
-  if (PollyRemarksMinimal) {
-    if (Sign == AS_ASSUMPTION) {
-      if (isl_set_is_subset(Context, Set))
-        return false;
+bool Scop::isEffectiveAssumption(__isl_keep isl_set *Set, AssumptionSign Sign) {
+  if (Sign == AS_ASSUMPTION) {
+    if (isl_set_is_subset(Context, Set))
+      return false;
 
-      if (isl_set_is_subset(AssumedContext, Set))
-        return false;
-    } else {
-      if (isl_set_is_disjoint(Set, Context))
-        return false;
+    if (isl_set_is_subset(AssumedContext, Set))
+      return false;
+  } else {
+    if (isl_set_is_disjoint(Set, Context))
+      return false;
 
-      if (isl_set_is_subset(Set, InvalidContext))
-        return false;
-    }
+    if (isl_set_is_subset(Set, InvalidContext))
+      return false;
   }
+  return true;
+}
+
+bool Scop::trackAssumption(AssumptionKind Kind, __isl_keep isl_set *Set,
+                           DebugLoc Loc, AssumptionSign Sign) {
+  if (PollyRemarksMinimal && !isEffectiveAssumption(Set, Sign))
+    return false;
 
   auto &F = getFunction();
   auto Suffix = Sign == AS_ASSUMPTION ? " assumption:\t" : " restriction:\t";




More information about the llvm-commits mailing list