diff options
author | Cameron Zwarich <zwarich@apple.com> | 2013-02-12 03:49:17 +0000 |
---|---|---|
committer | Cameron Zwarich <zwarich@apple.com> | 2013-02-12 03:49:17 +0000 |
commit | af34931c638ebb902dfac99942e564e5a0ed8521 (patch) | |
tree | 780e69a9cd52fa32172b9447ba9ef9e65ce789f6 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 10a3ae70393155fcb1bb009edb63b1143799b377 (diff) | |
download | bcm5719-llvm-af34931c638ebb902dfac99942e564e5a0ed8521.tar.gz bcm5719-llvm-af34931c638ebb902dfac99942e564e5a0ed8521.zip |
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.
llvm-svn: 174935
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 7351302cc32..71d59f0b4b3 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -796,8 +796,8 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) { MachineOperand &MO = I->getOperand(ni); unsigned Reg = MO.getReg(); PHISrcRegs.insert(Reg); - if (MO.isUndef() || !isLastMBB) - break; + if (MO.isUndef()) + continue; LiveInterval &LI = LIS->getInterval(Reg); VNInfo *VNI = LI.getVNInfoAt(PrevIndex); @@ -817,16 +817,7 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) { if (!LI.liveAt(PrevIndex)) continue; - bool isLiveOut = false; - 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; - } - } - + bool isLiveOut = LI.liveAt(LIS->getMBBStartIdx(Succ)); if (isLiveOut && isLastMBB) { VNInfo *VNI = LI.getVNInfoAt(PrevIndex); assert(VNI && "LiveInterval should have VNInfo where it is live."); |