llvm-project/polly
Michael Kruse cad9f98a2a [Polly] Don't generate inter-iteration noalias metadata.
This metadata was intended to mark all accesses within an iteration to be pairwise non-aliasing, in this case because every memory of a base pointer is touched (read or write) at most once. This is typical for 'sweeps' over all data. The stated motivation from D30606 is to ensure that unrolled iterations are considered non-aliasing.

Rhe implemention had multiple issues:

 * The structure of the noalias metadata was malformed. D110026 added check in the verifier for this metadata, and the tests were failing since then.

 * This is not true for the outer loops of the BLIS matrix multiplication, where it was being inserted. Each element of A, B, C is accessed multiple times, as often as the loop not used as an index is iterating.

 * Scopes were added to SecondLevelOtherAliasScopeList (used for the !noalias scop list) on-the-fly when another SCEV was seen. This meant that previously visited instructions would not be updated with alias scopes that are only seen later, missing out those SCEVs they should not be aliasing with.

 * Since the !noalias scope list would ideally consists of all other SCEV for this base pointer, we might run quickly into scalability issues. Especially after unrolling there would probably at least once SCEV per instruction and unroll instance.

 * The inter-iteration noalias base pointer was not removed after leaving the loop marked with it, effectively marking everything after it to noalias as well.

A solution I considered was to mark each instruction as non-aliasing with its own scope. The instruction itself would obviously alias itself, but such construction might also be considered invalid. Duplicating the instruction (e.g. due to speculation) would mark the instruction non-aliasing with its clone. I don't want to go into this territory, especially since the original motivation of determining unrolled instances as noalias based on SCEV is the what scev-aa does as well.

This effectively reverts D30606 and D35761.
2021-09-20 22:20:17 -05:00
..
cmake [Windows][Polly] Disable LLVMPolly module for all compilers on Windows 2020-09-15 09:12:38 +03:00
docs polly: remove the old reference to svn in the doc 2021-08-27 10:46:50 +02:00
include/polly [Polly] Don't generate inter-iteration noalias metadata. 2021-09-20 22:20:17 -05:00
lib [Polly] Don't generate inter-iteration noalias metadata. 2021-09-20 22:20:17 -05:00
test [Polly] Don't generate inter-iteration noalias metadata. 2021-09-20 22:20:17 -05:00
tools Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
unittests [Polly] Don't redundantly link libPolly into unittests. 2021-08-24 03:07:30 -05:00
utils Harmonize Python shebang 2020-07-16 21:53:45 +02:00
www [Branch-Rename] Fix some links 2021-02-01 16:43:21 +05:30
.arclint
.gitattributes
.gitignore
CMakeLists.txt Remove .svn from exclude list as we moved to git 2020-10-21 16:09:21 +02:00
CREDITS.txt
LICENSE.TXT Rename top-level LICENSE.txt files to LICENSE.TXT 2021-03-10 21:26:24 -08: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.