Skip to content

Commit c0e441a

Browse files
cuviperllvmbot
authored andcommitted
[RegAllocFast] Handle new debug values for spills
These new debug values get inserted after the place where the spill happens, which means they won't be reached by the reverse traversal of basic block instructions. This would crash or fail assertions if they contained any virtual registers to be replaced. We can manually handle the new debug values right away to resolve this. Fixes llvm/llvm-project#59172 Reviewed By: StephenTozer Differential Revision: https://reviews.llvm.org/D139590 (cherry picked from commit 87f57f4)
1 parent a8af9f6 commit c0e441a

File tree

2 files changed

+253
-0
lines changed

2 files changed

+253
-0
lines changed

llvm/lib/CodeGen/RegAllocFast.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,9 @@ void RegAllocFast::spill(MachineBasicBlock::iterator Before, Register VirtReg,
443443
SpilledOperandsMap[MO->getParent()].push_back(MO);
444444
for (auto MISpilledOperands : SpilledOperandsMap) {
445445
MachineInstr &DBG = *MISpilledOperands.first;
446+
// We don't have enough support for tracking operands of DBG_VALUE_LISTs.
447+
if (DBG.isDebugValueList())
448+
continue;
446449
MachineInstr *NewDV = buildDbgValueForSpill(
447450
*MBB, Before, *MISpilledOperands.first, FI, MISpilledOperands.second);
448451
assert(NewDV->getParent() == MBB && "dangling parent pointer");

0 commit comments

Comments
 (0)