mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
LiveIntervalAnalysis: Factor out code to update liveness on physreg 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226687 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1142,13 +1142,8 @@ foldMemoryOperand(ArrayRef<std::pair<MachineInstr*, unsigned> > Ops,
|
||||
continue;
|
||||
// FoldMI does not define this physreg. Remove the LI segment.
|
||||
assert(MO->isDead() && "Cannot fold physreg def");
|
||||
for (MCRegUnitIterator Units(Reg, &TRI); Units.isValid(); ++Units) {
|
||||
if (LiveRange *LR = LIS.getCachedRegUnit(*Units)) {
|
||||
SlotIndex Idx = LIS.getInstructionIndex(MI).getRegSlot();
|
||||
if (VNInfo *VNI = LR->getVNInfoAt(Idx))
|
||||
LR->removeValNo(VNI);
|
||||
}
|
||||
}
|
||||
SlotIndex Idx = LIS.getInstructionIndex(MI).getRegSlot();
|
||||
LIS.removePhysRegDefAt(Reg, Idx);
|
||||
}
|
||||
|
||||
LIS.ReplaceMachineInstrInMaps(MI, FoldMI);
|
||||
|
Reference in New Issue
Block a user