[polly] r240775 - Drop divs before adding array-out-of-bounds assumptions

Tobias Grosser tobias at grosser.es
Fri Jun 26 05:09:29 PDT 2015


Author: grosser
Date: Fri Jun 26 07:09:28 2015
New Revision: 240775

URL: http://llvm.org/viewvc/llvm-project?rev=240775&view=rev
Log:
Drop divs before adding array-out-of-bounds assumptions

In case we have modulo operations in the access function (supported since
r240518), the assumptions generated to ensure array accesses remain within
bounds can contain existentially quantified dimensions which results in more
complex and more difficult to handle integer sets. As a result LNT's linpack
benchmark started to fail due to excessive compile time.

We now just drop the existentially quantified dimensions. This should be
generally save, but may result in less precise assumptions which may
consequently make us fall back to the original (unoptimized) code more often. In
practice, these cases probably do not appear to often.

I had difficulties to extract a good test case, but fortunately our LNT bots
cover this one well.

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=240775&r1=240774&r2=240775&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Fri Jun 26 07:09:28 2015
@@ -559,6 +559,12 @@ void MemoryAccess::assumeNoOutOfBound(co
   Outside = isl_set_apply(Outside, isl_map_reverse(getAccessRelation()));
   Outside = isl_set_intersect(Outside, Statement->getDomain());
   Outside = isl_set_params(Outside);
+
+  // Remove divs to avoid the construction of overly complicated assumptions.
+  // Doing so increases the set of parameter combinations that are assumed to
+  // not appear. This is always save, but may make the resulting run-time check
+  // bail out more often than strictly necessary.
+  Outside = isl_set_remove_divs(Outside);
   Outside = isl_set_complement(Outside);
   Statement->getParent()->addAssumption(Outside);
   isl_space_free(Space);





More information about the llvm-commits mailing list