llvm-project/polly/lib/Analysis
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
..
DependenceInfo.cpp [DepInfo] Print -debug output outside of max-operations scope. 2016-10-10 11:45:59 +00:00
PolyhedralInfo.cpp Perform copying to created arrays according to the packing transformation 2016-09-14 06:26:09 +00:00
ScopBuilder.cpp [ScopInfo] Make memset etc. affine where possible. 2016-11-01 20:53:11 +00:00
ScopDetection.cpp Do not allow switch statements in loop latches 2016-11-10 05:20:29 +00:00
ScopDetectionDiagnostic.cpp [ScopDetection] Remove redundant checks for endless loops 2016-09-20 17:05:22 +00:00
ScopGraphPrinter.cpp Migrate from NodeType * to NodeRef. 2016-08-22 22:30:27 +00:00
ScopInfo.cpp SCEVAffinator: pass parameter-only set to addRestriction if BB=nullptr 2016-11-10 11:44:10 +00:00
ScopPass.cpp Decouple SCoP building logic from pass 2016-05-31 09:41:04 +00:00