[polly] r245617 - Do not intersect with AssumedContext in calculateMinMaxAccess

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 14:29:26 PDT 2015


Author: grosser
Date: Thu Aug 20 16:29:26 2015
New Revision: 245617

URL: http://llvm.org/viewvc/llvm-project?rev=245617&view=rev
Log:
Do not intersect with AssumedContext in calculateMinMaxAccess

Originally, we intersected the iteration space with the AssumedContext before
computing the minimal/maximal memory offset in our run-time alias checks. With
this patch we drop this intersection as the AssumedContext can - for larger or
more complex scops - become very complicated (contain many disjuncts). When
intersecting an object with many disjuncts with other objects, the number of
disjuncts in these other objects also increases quickly. As a result, the
compile time is unnecessarily increased. This patch now drops the intersection
with the assumed context to ensure we do not pay unnecessary compile time
costs.

With this patch we see -3.17% reduction in compile time for 3mm with default
flags and -17.87% when compiling 3mm with -DPOLYBENCH_USE_C99_PROTO flag. We
did not observe any regressions in LNT.

Contributed-by: Pratik Bhatu <cs12b1010 at iith.ac.in>

Reviewers: grosser

Differential Revision: http://reviews.llvm.org/D12198

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=245617&r1=245616&r2=245617&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Thu Aug 20 16:29:26 2015
@@ -1339,12 +1339,10 @@ static __isl_give isl_set *getAccessDoma
 /// @brief Wrapper function to calculate minimal/maximal accesses to each array.
 static bool calculateMinMaxAccess(__isl_take isl_union_map *Accesses,
                                   __isl_take isl_union_set *Domains,
-                                  __isl_take isl_set *AssumedContext,
                                   Scop::MinMaxVectorTy &MinMaxAccesses) {
 
   Accesses = isl_union_map_intersect_domain(Accesses, Domains);
   isl_union_set *Locations = isl_union_map_range(Accesses);
-  Locations = isl_union_set_intersect_params(Locations, AssumedContext);
   Locations = isl_union_set_coalesce(Locations);
   Locations = isl_union_set_detect_equalities(Locations);
   bool Valid = (0 == isl_union_set_foreach_set(Locations, buildMinMaxAccess,
@@ -1497,8 +1495,8 @@ bool Scop::buildAliasGroups(AliasAnalysi
     for (MemoryAccess *MA : AG)
       Accesses = isl_union_map_add_map(Accesses, MA->getAccessRelation());
 
-    bool Valid = calculateMinMaxAccess(
-        Accesses, getDomains(), getAssumedContext(), MinMaxAccessesNonReadOnly);
+    bool Valid = calculateMinMaxAccess(Accesses, getDomains(),
+                                       MinMaxAccessesNonReadOnly);
 
     // 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
@@ -1515,8 +1513,8 @@ bool Scop::buildAliasGroups(AliasAnalysi
       for (MemoryAccess *MA : ReadOnlyPair.second)
         Accesses = isl_union_map_add_map(Accesses, MA->getAccessRelation());
 
-    Valid = calculateMinMaxAccess(Accesses, getDomains(), getAssumedContext(),
-                                  MinMaxAccessesReadOnly);
+    Valid =
+        calculateMinMaxAccess(Accesses, getDomains(), MinMaxAccessesReadOnly);
 
     if (!Valid)
       return false;




More information about the llvm-commits mailing list