mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-14 09:38:40 +00:00
Terminate all dead defs at the dead slot instead of the 'next' slot.
This makes no difference for normal defs, but early clobber dead defs now look like: [Slot_EarlyClobber; Slot_Dead) instead of: [Slot_EarlyClobber; Slot_Register). Live ranges for normal dead defs look like: [Slot_Register; Slot_Dead) as before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144512 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f9fd29ea34
commit
1f81e316b0
@ -1206,7 +1206,7 @@ void InlineSpiller::spillAroundUses(unsigned Reg) {
|
|||||||
// This instruction defines a dead value. We don't need to spill it,
|
// This instruction defines a dead value. We don't need to spill it,
|
||||||
// but do create a live range for the dead value.
|
// but do create a live range for the dead value.
|
||||||
VNInfo *VNI = NewLI.getNextValue(Idx, 0, LIS.getVNInfoAllocator());
|
VNInfo *VNI = NewLI.getNextValue(Idx, 0, LIS.getVNInfoAllocator());
|
||||||
NewLI.addRange(LiveRange(Idx, Idx.getNextSlot(), VNI));
|
NewLI.addRange(LiveRange(Idx, Idx.getDeadSlot(), VNI));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -686,7 +686,7 @@ bool LiveIntervals::shrinkToUses(LiveInterval *li,
|
|||||||
VNInfo *VNI = *I;
|
VNInfo *VNI = *I;
|
||||||
if (VNI->isUnused())
|
if (VNI->isUnused())
|
||||||
continue;
|
continue;
|
||||||
NewLI.addRange(LiveRange(VNI->def, VNI->def.getNextSlot(), VNI));
|
NewLI.addRange(LiveRange(VNI->def, VNI->def.getDeadSlot(), VNI));
|
||||||
|
|
||||||
// A use tied to an early-clobber def ends at the load slot and isn't caught
|
// A use tied to an early-clobber def ends at the load slot and isn't caught
|
||||||
// above. Catch it here instead. This probably only ever happens for inline
|
// above. Catch it here instead. This probably only ever happens for inline
|
||||||
@ -751,7 +751,7 @@ bool LiveIntervals::shrinkToUses(LiveInterval *li,
|
|||||||
continue;
|
continue;
|
||||||
LiveInterval::iterator LII = NewLI.FindLiveRangeContaining(VNI->def);
|
LiveInterval::iterator LII = NewLI.FindLiveRangeContaining(VNI->def);
|
||||||
assert(LII != NewLI.end() && "Missing live range for PHI");
|
assert(LII != NewLI.end() && "Missing live range for PHI");
|
||||||
if (LII->end != VNI->def.getNextSlot())
|
if (LII->end != VNI->def.getDeadSlot())
|
||||||
continue;
|
continue;
|
||||||
if (VNI->isPHIDef()) {
|
if (VNI->isPHIDef()) {
|
||||||
// This is a dead PHI. Remove it.
|
// This is a dead PHI. Remove it.
|
||||||
|
@ -366,14 +366,14 @@ VNInfo *SplitEditor::defValue(unsigned RegIdx,
|
|||||||
// If the previous value was a simple mapping, add liveness for it now.
|
// If the previous value was a simple mapping, add liveness for it now.
|
||||||
if (VNInfo *OldVNI = InsP.first->second.getPointer()) {
|
if (VNInfo *OldVNI = InsP.first->second.getPointer()) {
|
||||||
SlotIndex Def = OldVNI->def;
|
SlotIndex Def = OldVNI->def;
|
||||||
LI->addRange(LiveRange(Def, Def.getNextSlot(), OldVNI));
|
LI->addRange(LiveRange(Def, Def.getDeadSlot(), OldVNI));
|
||||||
// No longer a simple mapping. Switch to a complex, non-forced mapping.
|
// No longer a simple mapping. Switch to a complex, non-forced mapping.
|
||||||
InsP.first->second = ValueForcePair();
|
InsP.first->second = ValueForcePair();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a complex mapping, add liveness for VNI
|
// This is a complex mapping, add liveness for VNI
|
||||||
SlotIndex Def = VNI->def;
|
SlotIndex Def = VNI->def;
|
||||||
LI->addRange(LiveRange(Def, Def.getNextSlot(), VNI));
|
LI->addRange(LiveRange(Def, Def.getDeadSlot(), VNI));
|
||||||
|
|
||||||
return VNI;
|
return VNI;
|
||||||
}
|
}
|
||||||
@ -393,7 +393,7 @@ void SplitEditor::forceRecompute(unsigned RegIdx, const VNInfo *ParentVNI) {
|
|||||||
// This was previously a single mapping. Make sure the old def is represented
|
// This was previously a single mapping. Make sure the old def is represented
|
||||||
// by a trivial live range.
|
// by a trivial live range.
|
||||||
SlotIndex Def = VNI->def;
|
SlotIndex Def = VNI->def;
|
||||||
Edit->get(RegIdx)->addRange(LiveRange(Def, Def.getNextSlot(), VNI));
|
Edit->get(RegIdx)->addRange(LiveRange(Def, Def.getDeadSlot(), VNI));
|
||||||
// Mark as complex mapped, forced.
|
// Mark as complex mapped, forced.
|
||||||
VFP = ValueForcePair(0, true);
|
VFP = ValueForcePair(0, true);
|
||||||
}
|
}
|
||||||
@ -994,8 +994,8 @@ void SplitEditor::deleteRematVictims() {
|
|||||||
LiveInterval *LI = *I;
|
LiveInterval *LI = *I;
|
||||||
for (LiveInterval::const_iterator LII = LI->begin(), LIE = LI->end();
|
for (LiveInterval::const_iterator LII = LI->begin(), LIE = LI->end();
|
||||||
LII != LIE; ++LII) {
|
LII != LIE; ++LII) {
|
||||||
// Dead defs end at the store slot.
|
// Dead defs end at the dead slot.
|
||||||
if (LII->end != LII->valno->def.getNextSlot())
|
if (LII->end != LII->valno->def.getDeadSlot())
|
||||||
continue;
|
continue;
|
||||||
MachineInstr *MI = LIS.getInstructionFromIndex(LII->valno->def);
|
MachineInstr *MI = LIS.getInstructionFromIndex(LII->valno->def);
|
||||||
assert(MI && "Missing instruction for dead def");
|
assert(MI && "Missing instruction for dead def");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user