mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-20 09:24:58 +00:00
Only trim a live interval if the register is not used after the PHI node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54421 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
788d04152a
commit
9b49120408
@ -896,13 +896,16 @@ bool StrongPHIElimination::runOnMachineFunction(MachineFunction &Fn) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Trim live intervals of input registers. They are no longer live into
|
// Trim live intervals of input registers. They are no longer live into
|
||||||
// this block.
|
// this block if they died after the PHI. If they lived after it, don't
|
||||||
|
// trim them because they might have other legitimate uses.
|
||||||
for (unsigned i = 1; i < PInstr->getNumOperands(); i += 2) {
|
for (unsigned i = 1; i < PInstr->getNumOperands(); i += 2) {
|
||||||
unsigned reg = PInstr->getOperand(i).getReg();
|
unsigned reg = PInstr->getOperand(i).getReg();
|
||||||
MachineBasicBlock* MBB = PInstr->getOperand(i+1).getMBB();
|
MachineBasicBlock* MBB = PInstr->getOperand(i+1).getMBB();
|
||||||
LiveInterval& InputI = LI.getInterval(reg);
|
LiveInterval& InputI = LI.getInterval(reg);
|
||||||
if (MBB != PInstr->getParent() &&
|
if (MBB != PInstr->getParent() &&
|
||||||
InputI.liveAt(LI.getMBBStartIdx(PInstr->getParent())))
|
InputI.liveAt(LI.getMBBStartIdx(PInstr->getParent())) &&
|
||||||
|
InputI.expiredAt(LI.getInstructionIndex(PInstr) +
|
||||||
|
LiveIntervals::InstrSlots::NUM))
|
||||||
InputI.removeRange(LI.getMBBStartIdx(PInstr->getParent()),
|
InputI.removeRange(LI.getMBBStartIdx(PInstr->getParent()),
|
||||||
LI.getInstructionIndex(PInstr),
|
LI.getInstructionIndex(PInstr),
|
||||||
true);
|
true);
|
||||||
|
Loading…
Reference in New Issue
Block a user