Skip to content

Commit daaed0e

Browse files
committedAug 20, 2015
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@iith.ac.in> Reviewers: grosser Differential Revision: http://reviews.llvm.org/D12198 llvm-svn: 245617
1 parent 6569387 commit daaed0e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed
 

‎polly/lib/Analysis/ScopInfo.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -1339,12 +1339,10 @@ static __isl_give isl_set *getAccessDomain(MemoryAccess *MA) {
13391339
/// @brief Wrapper function to calculate minimal/maximal accesses to each array.
13401340
static bool calculateMinMaxAccess(__isl_take isl_union_map *Accesses,
13411341
__isl_take isl_union_set *Domains,
1342-
__isl_take isl_set *AssumedContext,
13431342
Scop::MinMaxVectorTy &MinMaxAccesses) {
13441343

13451344
Accesses = isl_union_map_intersect_domain(Accesses, Domains);
13461345
isl_union_set *Locations = isl_union_map_range(Accesses);
1347-
Locations = isl_union_set_intersect_params(Locations, AssumedContext);
13481346
Locations = isl_union_set_coalesce(Locations);
13491347
Locations = isl_union_set_detect_equalities(Locations);
13501348
bool Valid = (0 == isl_union_set_foreach_set(Locations, buildMinMaxAccess,
@@ -1497,8 +1495,8 @@ bool Scop::buildAliasGroups(AliasAnalysis &AA) {
14971495
for (MemoryAccess *MA : AG)
14981496
Accesses = isl_union_map_add_map(Accesses, MA->getAccessRelation());
14991497

1500-
bool Valid = calculateMinMaxAccess(
1501-
Accesses, getDomains(), getAssumedContext(), MinMaxAccessesNonReadOnly);
1498+
bool Valid = calculateMinMaxAccess(Accesses, getDomains(),
1499+
MinMaxAccessesNonReadOnly);
15021500

15031501
// Bail out if the number of values we need to compare is too large.
15041502
// This is important as the number of comparisions grows quadratically with
@@ -1515,8 +1513,8 @@ bool Scop::buildAliasGroups(AliasAnalysis &AA) {
15151513
for (MemoryAccess *MA : ReadOnlyPair.second)
15161514
Accesses = isl_union_map_add_map(Accesses, MA->getAccessRelation());
15171515

1518-
Valid = calculateMinMaxAccess(Accesses, getDomains(), getAssumedContext(),
1519-
MinMaxAccessesReadOnly);
1516+
Valid =
1517+
calculateMinMaxAccess(Accesses, getDomains(), MinMaxAccessesReadOnly);
15201518

15211519
if (!Valid)
15221520
return false;

0 commit comments

Comments
 (0)
Please sign in to comment.