mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 06:25:18 +00:00
Debug info: If the RegisterCoalescer::reMaterializeTrivialDef() is
eliminating all uses of a vreg, update any DBG_VALUE describing that vreg to point to the rematerialized register instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223401 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -898,8 +898,20 @@ bool RegisterCoalescer::reMaterializeTrivialDef(CoalescerPair &CP,
|
||||
|
||||
// The source interval can become smaller because we removed a use.
|
||||
LIS->shrinkToUses(&SrcInt, &DeadDefs);
|
||||
if (!DeadDefs.empty())
|
||||
if (!DeadDefs.empty()) {
|
||||
// If the virtual SrcReg is completely eliminated, update all DBG_VALUEs
|
||||
// to describe DstReg instead.
|
||||
for (MachineRegisterInfo::use_iterator UI = MRI->use_begin(SrcReg),
|
||||
UE = MRI->use_end(); UI != UE; ++UI) {
|
||||
MachineOperand &UseMO = *UI;
|
||||
MachineInstr *UseMI = UseMO.getParent();
|
||||
if (UseMI->isDebugValue()) {
|
||||
UseMO.setReg(DstReg);
|
||||
DEBUG({dbgs() << "\t\tupdated: " << *UseMI;});
|
||||
}
|
||||
}
|
||||
eliminateDeadDefs();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user