[DeLICM] Allow non-injective PHIRead->PHIWrite mapping.
commit3c3b1ac6502fd943e18b8e98f204b8f9feb65173
authorMichael Kruse <llvm@meinersbur.de>
Thu, 21 Sep 2017 19:08:23 +0000 (21 19:08 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Thu, 21 Sep 2017 19:08:23 +0000 (21 19:08 +0000)
treed159700137f511c566effcc9e36968fc5c0c04ff
parent2d3f56beb5f500d48d499bfdef431f0d80d590a1
[DeLICM] Allow non-injective PHIRead->PHIWrite mapping.

Remove an assertion that tests the injectivity of the
PHIRead -> PHIWrite relation.  That is, allow a single PHI write to be
used by multiple PHI reads.  This may happen due to some statements
containing the PHI write not having the statement instances that would
overwrite the previous incoming value due to (assumed/invalid) contexts.
This result in that PHI write is mapped to multiple targets which is not
supported.  Codegen will select one one of the targets using
getAddressFunction().  However, the runtime check should protect us from
this case ever being executed.

We therefore allow injective PHI relations.  Additional calculations to
detect/santitize this case would probably not be worth the compuational
effort.

This fixes llvm.org/PR34485

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@313902 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transform/DeLICM.cpp
test/DeLICM/noninjective_phi_relation.ll [new file with mode: 0644]