mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-04 06:26:28 +00:00
LiveIntervalAnalysis: Factor out code to update liveness on vreg def removal
This cleans up code and is more in line with the general philosophy of modifying LiveIntervals through LiveIntervalAnalysis instead of changing them directly. This also fixes a case where SplitEditor::removeBackCopies() would miss the subregister ranges. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226690 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -273,21 +273,11 @@ void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink) {
|
||||
|
||||
// Remove defined value.
|
||||
if (MOI->isDef()) {
|
||||
if (VNInfo *VNI = LI.getVNInfoAt(Idx)) {
|
||||
if (TheDelegate)
|
||||
TheDelegate->LRE_WillShrinkVirtReg(LI.reg);
|
||||
LI.removeValNo(VNI);
|
||||
if (LI.empty()) {
|
||||
RegsToErase.push_back(Reg);
|
||||
} else {
|
||||
// Also remove the value in subranges.
|
||||
for (LiveInterval::SubRange &S : LI.subranges()) {
|
||||
if (VNInfo *SVNI = S.getVNInfoAt(Idx))
|
||||
S.removeValNo(SVNI);
|
||||
}
|
||||
LI.removeEmptySubRanges();
|
||||
}
|
||||
}
|
||||
if (TheDelegate && LI.getVNInfoAt(Idx) != nullptr)
|
||||
TheDelegate->LRE_WillShrinkVirtReg(LI.reg);
|
||||
LIS.removeVRegDefAt(LI, Idx);
|
||||
if (LI.empty())
|
||||
RegsToErase.push_back(Reg);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user