[PHIElimination] Fix the killed flag for LowerPHINode()
authorKang Zhang <shkzhang@cn.ibm.com>
Thu, 30 Jul 2020 08:18:50 +0000 (08:18 +0000)
committerKang Zhang <shkzhang@cn.ibm.com>
Thu, 30 Jul 2020 08:18:50 +0000 (08:18 +0000)
commit0037a5f894345eef5552d6620548cc8ad5900b41
treeb2970674e64f4ce1c788cebe26d1ef72ff5d26e3
parent3aab320557e7441bc2ce0b51fd6d82838fd0d484
[PHIElimination] Fix the killed flag for LowerPHINode()

Summary:
In the phi-node-elimination pass, we set the killed flag incorrectly.
When we eliminate the PHI node, we replace the PHI with a copy for the
incoming value.

Before this patch, we will set incoming value as killed(PHICopy). And
we will remove the killed flag from last using incoming value(OldKill).
This is correct, only if the new PHICopy is after the OldKill.

Reviewed By: bjope

Differential Revision: https://reviews.llvm.org/D80886
llvm/lib/CodeGen/PHIElimination.cpp
llvm/test/CodeGen/PowerPC/phi-eliminate.mir [new file with mode: 0644]