Allow mapping scalar MemoryAccesses to array elements.
authorMichael Kruse <llvm@meinersbur.de>
Thu, 1 Sep 2016 19:53:31 +0000 (19:53 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Thu, 1 Sep 2016 19:53:31 +0000 (19:53 +0000)
commit2fa35194632ce6ebfa2d6782afd62e1274d2e225
tree8f4280816e8db990501772e386002a1fa01b0824
parenta78187a385f742dfa53c172772dee2fdb9bfe6bc
Allow mapping scalar MemoryAccesses to array elements.

Change the code around setNewAccessRelation to allow to use a an existing array
element for memory instead of an ad-hoc alloca. This facility will be used for
DeLICM/DeGVN to convert scalar dependencies into regular ones.

The changes necessary include:
- Make the code generator use the implicit locations instead of the alloca ones.
- A test case
- Make the JScop importer accept changes of scalar accesses for that test case.
- Adapt the MemoryAccess interface to the fact that the MemoryKind can change.
  They are named (get|is)OriginalXXX() to get the status of the memory access
  before any change by setNewAccessRelation() (some properties such as
  getIncoming() do not change even if the kind is changed and are still
  required). To get the modified properties, there is (get|is)LatestXXX(). The
  old accessors without Original|Latest become synonyms of the
  (get|is)OriginalXXX() to not make functional changes in unrelated code.

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

llvm-svn: 280408
polly/include/polly/CodeGen/BlockGenerators.h
polly/include/polly/ScopInfo.h
polly/lib/Analysis/ScopInfo.cpp
polly/lib/CodeGen/BlockGenerators.cpp
polly/lib/Exchange/JSONExporter.cpp
polly/test/Isl/CodeGen/MemAccess/map_scalar_access.ll [new file with mode: 0644]
polly/test/Isl/CodeGen/MemAccess/map_scalar_access___%outer.for---%return.jscop [new file with mode: 0644]
polly/test/Isl/CodeGen/MemAccess/map_scalar_access___%outer.for---%return.jscop.transformed [new file with mode: 0644]