Fix the updating of LiveIntervals after splitting a critical edge. PHI operand

live ranges should always be extended, and the only successor that should be
considered for extension of other ranges is the target of the split edge.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174935 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Cameron Zwarich 2013-02-12 03:49:17 +00:00
parent b0fde6dc02
commit dbf10c4349

View File

@ -796,8 +796,8 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
MachineOperand &MO = I->getOperand(ni); MachineOperand &MO = I->getOperand(ni);
unsigned Reg = MO.getReg(); unsigned Reg = MO.getReg();
PHISrcRegs.insert(Reg); PHISrcRegs.insert(Reg);
if (MO.isUndef() || !isLastMBB) if (MO.isUndef())
break; continue;
LiveInterval &LI = LIS->getInterval(Reg); LiveInterval &LI = LIS->getInterval(Reg);
VNInfo *VNI = LI.getVNInfoAt(PrevIndex); VNInfo *VNI = LI.getVNInfoAt(PrevIndex);
@ -817,16 +817,7 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
if (!LI.liveAt(PrevIndex)) if (!LI.liveAt(PrevIndex))
continue; continue;
bool isLiveOut = false; bool isLiveOut = LI.liveAt(LIS->getMBBStartIdx(Succ));
for (MachineBasicBlock::succ_iterator SI = succ_begin(),
SE = succ_end(); SI != SE; ++SI) {
MachineBasicBlock *SuccMBB = *SI == NMBB ? Succ : *SI;
if (LI.liveAt(LIS->getMBBStartIdx(SuccMBB))) {
isLiveOut = true;
break;
}
}
if (isLiveOut && isLastMBB) { if (isLiveOut && isLastMBB) {
VNInfo *VNI = LI.getVNInfoAt(PrevIndex); VNInfo *VNI = LI.getVNInfoAt(PrevIndex);
assert(VNI && "LiveInterval should have VNInfo where it is live."); assert(VNI && "LiveInterval should have VNInfo where it is live.");