Allow mapping scalar MemoryAccesses to array elements.
commite17692f6362b967f8912f96cf7d34b64bf7492d3
authorMichael Kruse <llvm@meinersbur.de>
Thu, 1 Sep 2016 19:53:31 +0000 (1 19:53 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Thu, 1 Sep 2016 19:53:31 +0000 (1 19:53 +0000)
treec7838872e9b1ede476b14d5006b0298b4c953ef5
parentcf73b6c5110b04c781d8e4559fd2461d97733080
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

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@280408 91177308-0d34-0410-b5e6-96231b3b80d8
include/polly/CodeGen/BlockGenerators.h
include/polly/ScopInfo.h
lib/Analysis/ScopInfo.cpp
lib/CodeGen/BlockGenerators.cpp
lib/Exchange/JSONExporter.cpp
test/Isl/CodeGen/MemAccess/map_scalar_access.ll [new file with mode: 0644]
test/Isl/CodeGen/MemAccess/map_scalar_access___%outer.for---%return.jscop [new file with mode: 0644]
test/Isl/CodeGen/MemAccess/map_scalar_access___%outer.for---%return.jscop.transformed [new file with mode: 0644]