[Polly] Fully-Indexed static expansion
authorAndreas Simbuerger <simbuerg@fim.uni-passau.de>
Mon, 7 Aug 2017 20:54:20 +0000 (20:54 +0000)
committerAndreas Simbuerger <simbuerg@fim.uni-passau.de>
Mon, 7 Aug 2017 20:54:20 +0000 (20:54 +0000)
commit81fb6b3e4085cd7f21f0633629532c718047fa9b
treede8da630ea5b0aff147a8c5fb54e67cd8674354f
parentc85d26b0f3dbef5d78c330c4610e355766fdbb0f
[Polly] Fully-Indexed static expansion

This commit implements the initial version of fully-indexed static
expansion.

```
 for(int i = 0; i<Ni; i++)
   for(int j = 0; j<Ni; j++)
S:     B[j] = j;
T: A[i] = B[i]
```

After the pass, we want this :
```
 for(int i = 0; i<Ni; i++)
   for(int j = 0; j<Ni; j++)
S:     B[i][j] = j;
T: A[i] = B[i][i]
```

For now we bail (fail) in the following cases:
  - Scalar access
  - Multiple writes per SAI
  - MayWrite Access
  - Expansion that leads to an access to the original array

Furthermore: We still miss checks for escaping references to the array
base pointers. A future commit will add the missing escape-checks to
stay correct in those cases. The expansion is still locked behind a
CLI-Option and should not yet be used.

Patch contributed by: Nicholas Bonfante <bonfante.nicolas@gmail.com>

Reviewers: simbuerg, Meinersbur, bollu

Reviewed By: Meinersbur

Subscribers: mgorny, llvm-commits, pollydev

Differential Revision: https://reviews.llvm.org/D34982

llvm-svn: 310304
polly/include/polly/LinkAllPasses.h
polly/lib/CMakeLists.txt
polly/lib/Support/RegisterPasses.cpp
polly/lib/Transform/MaximalStaticExpansion.cpp [new file with mode: 0644]
polly/test/MaximalStaticExpansion/read_from_original.ll [new file with mode: 0644]
polly/test/MaximalStaticExpansion/too_many_writes.ll [new file with mode: 0644]
polly/test/MaximalStaticExpansion/working_expansion.ll [new file with mode: 0644]