[DeLICM] Do not try to map to multiple array elements.
authorMichael Kruse <llvm@meinersbur.de>
Tue, 24 Oct 2017 13:05:24 +0000 (13:05 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Tue, 24 Oct 2017 13:05:24 +0000 (13:05 +0000)
commit19cd61dc11eee8efcab92076f2ee4986bd432102
tree8562fd62b87b20fd064056d9e99499d071c74a4a
parent31b101a18613e1bbe6e3b5a630a2359be1be4f4b
[DeLICM] Do not try to map to multiple array elements.

Add check and skip when the store used to determine the target accesses
multiple array elements. Only a single array location should for
mapping the scalar. Having multiple creates problems when deciding which
element to load from. While MemoryAccess::getAddressFunction() should
select just one of them, other problems arise in code that assumes
that there is just one target element per statement instance.

This fixes llvm.org/PR34989

This also reverts r313902 which fixed llvm.org/PR34485 also caused by
a non-functional target array element. This patch avoids the situation
to occur in the first place.

llvm-svn: 316432
polly/lib/Transform/DeLICM.cpp
polly/test/DeLICM/noninjective_phi_relation.ll [deleted file]
polly/test/DeLICM/skip_multiaccess.ll [new file with mode: 0644]