hanchenye-llvm-project/polly
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
..
autoconf [autoconf/cmake] Make sure we detect the latest version of isl. 2013-07-02 14:11:32 +00:00
cmake [autoconf/cmake] Make sure we detect the latest version of isl. 2013-07-02 14:11:32 +00:00
docs
include Check scops a second time before working on them 2014-02-18 18:49:49 +00:00
lib Check scops a second time before working on them 2014-02-18 18:49:49 +00:00
test Check scops a second time before working on them 2014-02-18 18:49:49 +00:00
tools Update the copyright credits -- Happy new year 2014! 2014-01-01 08:27:31 +00:00
utils Update to isl 1b3ba3b72c0482fd36bf0b4a1186a259f7bafeed 2014-01-26 19:36:28 +00:00
www Add link to polyhedral.info 2014-02-11 23:34:43 +00:00
.gitattributes gitattributes: .png and .txt are no text files 2013-07-28 09:05:20 +00:00
CMakeLists.txt cmake: Provide path to installed clang-format 2013-11-22 22:42:13 +00:00
CREDITS.txt
LICENSE.txt Update the copyright credits -- Happy new year 2014! 2014-01-01 08:27:31 +00:00
Makefile Revert "Fix a bug introduced by r153739: We are not able to provide the correct" 2012-04-11 07:43:13 +00:00
Makefile.common.in 'chmod -x' on files that do not need the executable bits 2012-12-29 15:09:03 +00:00
Makefile.config.in 'chmod -x' on files that do not need the executable bits 2012-12-29 15:09:03 +00:00
README Trivial change to the README, mainly to test commit access. 2012-10-09 04:59:42 +00:00
configure [autoconf/cmake] Make sure we detect the latest version of isl. 2013-07-02 14:11:32 +00:00

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.