summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2015-08-20 21:29:26 +0000
committerTobias Grosser <tobias@grosser.es>2015-08-20 21:29:26 +0000
commitdaaed0e19f1fc2942095dff7a58542e59d3972cc (patch)
treedf33477c257c17f98ead38cb1781f71755dc0e03
parent65693873276757290e49f547cb7a6409b0f58c91 (diff)
downloadbcm5719-llvm-daaed0e19f1fc2942095dff7a58542e59d3972cc.tar.gz
bcm5719-llvm-daaed0e19f1fc2942095dff7a58542e59d3972cc.zip
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
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index d5e43970faf..28df84b0c24 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -1339,12 +1339,10 @@ static __isl_give isl_set *getAccessDomain(MemoryAccess *MA) {
/// @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(AliasAnalysis &AA) {
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(AliasAnalysis &AA) {
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;
OpenPOWER on IntegriCloud