hanchenye-llvm-project/polly/lib
Tobias Grosser a1689937ba Check scops a second time before working on them
In rare cases the modification of one scop can effect the validity of other
scops, as code generation of an earlier scop may make the scalar evolution
functions derived for later scops less precise. The example that triggered this
patch was a scop that contained an 'or' expression as follows:

  %add13710 = or i32 %j.19, 1
    -->  {(1 + (4 * %l)),+,2}<nsw><%for.body81>

Scev could only analyze the 'or' as it knew %j.19 is a multiple of 2. This
information was not available after the first scop was code generated (or
independent-blocks was run on it) and SCEV could not derive a precise SCEV
expression any more. This means we could not any more code generate this SCoP.
My current understanding is that there is always the risk that an earlier code
generation change invalidates later scops.  As the example we have seen here is
difficult to avoid, we use this occasion to guard us against all such
invalidations.

This patch "solves" this issue by verifying right before we start working on
a detected scop, if this scop is in fact still valid. This adds a certain
overhead. However the verification we run is anyways very fast and secondly
it is only run on detected scops. So the overhead should not be very large. As
a later optimization we could detect scops only on demand, such that we need
to run scop-detections always only a single time.

This should fix the single last failure in the LLVM test-suite for the new
scev-based code generation.

llvm-svn: 201593
2014-02-18 18:49:49 +00:00
..
Analysis Check scops a second time before working on them 2014-02-18 18:49:49 +00:00
CodeGen Update to isl 1b3ba3b72c0482fd36bf0b4a1186a259f7bafeed 2014-01-26 19:36:28 +00:00
Exchange llvm/IR/Writer.h has been removed in llvm commit r198836 and seems useless in polly 2014-01-16 07:10:09 +00:00
JSON prepend LLVM to all Polly* libs 2013-11-16 15:28:55 +00:00
Support ScopValidator: smax expressions are no parameters 2013-12-09 21:51:46 +00:00
CMakeLists.txt Introduce -polly-canonicalize pass 2014-01-02 23:39:18 +00:00
Canonicalization.cpp Introduce -polly-canonicalize pass 2014-01-02 23:39:18 +00:00
CodePreparation.cpp Adapt to DomTree changes in r199104 2014-01-13 22:29:56 +00:00
DeadCodeElimination.cpp include missing ISL header file 2013-05-31 17:41:17 +00:00
IndVarSimplify.cpp Adapt to DomTree changes in r199104 2014-01-13 22:29:56 +00:00
IndependentBlocks.cpp IndependentBlocks: Do not assert for PHI nodes outside of scops 2014-01-29 23:08:10 +00:00
Makefile
Pluto.cpp
Pocc.cpp clang-format latest changes 2013-07-02 16:13:07 +00:00
RegisterPasses.cpp Remove an unused parameter 2014-01-27 10:44:25 +00:00
ScheduleOptimizer.cpp Update to isl 1b3ba3b72c0482fd36bf0b4a1186a259f7bafeed 2014-01-26 19:36:28 +00:00