llvm-project/polly
Tobias Grosser f67433abd9 SCEVAffinator: pass parameter-only set to addRestriction if BB=nullptr
Assumptions can either be added for a given basic block, in which case the set
describing the assumptions is expected to match the dimensions of its domain.
In case no basic block is provided a parameter-only set is expected to describe
the assumption.

The piecewise expressions that are generated by the SCEVAffinator sometimes
have a zero-dimensional domain (e.g., [p] -> { [] : p <= -129 or p >= 128 }),
which looks similar to a parameter-only domain, but is still a set domain.

This change adds an assert that checks that we always pass parameter domains to
addAssumptions if BB is empty to make mismatches here fail early.

We also change visitTruncExpr to always convert to parameter sets, if BB is
null. This change resolves http://llvm.org/PR30941

Another alternative to this change would have been to inspect all code to make
sure we directly generate in the SCEV affinator parameter sets in case of empty
domains. However, this would likely complicate the code which combines parameter
and non-parameter domains when constructing a statement domain. We might still
consider doing this at some point, but as this likely requires several non-local
changes this should probably be done as a separate refactoring.

Reported-by: Eli Friedman <efriedma@codeaurora.org>
llvm-svn: 286444
2016-11-10 11:44:10 +00:00
..
cmake Remove -fvisibility=hidden and FORCE_STATIC. 2016-09-12 18:25:00 +00:00
docs docs: Remove reference to PoCC 2016-05-17 19:44:16 +00:00
include/polly [Polly CodeGen] Break critical edge from RTC to original loop. 2016-11-02 22:32:23 +00:00
lib SCEVAffinator: pass parameter-only set to addRestriction if BB=nullptr 2016-11-10 11:44:10 +00:00
test SCEVAffinator: pass parameter-only set to addRestriction if BB=nullptr 2016-11-10 11:44:10 +00:00
tools GPURuntime: ensure compilation with C99 2016-09-11 07:32:50 +00:00
unittests Add -polly-flatten-schedule pass. 2016-09-08 15:02:36 +00:00
utils Revise polly-{update|check}-format targets 2015-09-14 16:59:50 +00:00
www www: Add Loopy publication 2016-09-29 18:17:30 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
.arclint Adjusted arc linter config for modern version of arcanist 2015-08-12 09:01:16 +00:00
.gitattributes
.gitignore Add git patch files to .gitignore 2015-06-23 20:55:01 +00:00
CMakeLists.txt Remove POLLY_LINK_LIBS, it is not used 2016-11-04 00:32:32 +00:00
CREDITS.txt Add myself to the credits 2014-08-10 03:37:29 +00:00
LICENSE.txt Update copyright year to 2016. 2016-03-30 22:41:38 +00:00
README

README

Polly - Polyhedral optimizations for LLVM
-----------------------------------------
http://polly.llvm.org/

Polly uses a mathematical representation, the polyhedral model, to represent and
transform loops and other control flow structures. Using an abstract
representation it is possible to reason about transformations in a more general
way and to use highly optimized linear programming libraries to figure out the
optimal loop structure. These transformations can be used to do constant
propagation through arrays, remove dead loop iterations, optimize loops for
cache locality, optimize arrays, apply advanced automatic parallelization, drive
vectorization, or they can be used to do software pipelining.