[DeLICM] Allow non-injective PHIRead->PHIWrite mapping.
authorMichael Kruse <llvm@meinersbur.de>
Thu, 21 Sep 2017 19:08:23 +0000 (19:08 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Thu, 21 Sep 2017 19:08:23 +0000 (19:08 +0000)
commitbfca5f433476e54433ec7e0b05a6310b4e0d4692
tree2caaba139208beb36c92519ef110a334cfea346a
parent0dde08c3cbee9314e5cdc24d5295f1d98663a99f
[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

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