Don't consider definitions by other PHIs live-in when trimming a PHI source's

live range after inserting a copy at the end of a block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174945 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Cameron Zwarich 2013-02-12 05:48:58 +00:00
parent 8d49134eea
commit 4930e7266b

View File

@ -467,7 +467,11 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB,
bool isLiveOut = false;
for (MachineBasicBlock::succ_iterator SI = opBlock.succ_begin(),
SE = opBlock.succ_end(); SI != SE; ++SI) {
if (SrcLI.liveAt(LIS->getMBBStartIdx(*SI))) {
SlotIndex startIdx = LIS->getMBBStartIdx(*SI);
VNInfo *VNI = SrcLI.getVNInfoAt(startIdx);
// Definitions by other PHIs are not truly live-in for our purposes.
if (VNI && VNI->def != startIdx) {
isLiveOut = true;
break;
}