forked from OSchip/llvm-project
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. llvm-svn: 240775
This commit is contained in:
parent
eef7ffe2e9
commit
f54bb7743a
|
@ -559,6 +559,12 @@ void MemoryAccess::assumeNoOutOfBound(const IRAccess &Access) {
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue