Skip to content

Commit 87f57f4

Browse files
committed
[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 #59172 Reviewed By: StephenTozer Differential Revision: https://reviews.llvm.org/D139590
1 parent 143ec50 commit 87f57f4

File tree

2 files changed

+253
-0
lines changed

2 files changed

+253
-0
lines changed

llvm/lib/CodeGen/RegAllocFast.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,9 @@ void RegAllocFast::spill(MachineBasicBlock::iterator Before, Register VirtReg,
451451
SpilledOperandsMap[MO->getParent()].push_back(MO);
452452
for (auto MISpilledOperands : SpilledOperandsMap) {
453453
MachineInstr &DBG = *MISpilledOperands.first;
454+
// We don't have enough support for tracking operands of DBG_VALUE_LISTs.
455+
if (DBG.isDebugValueList())
456+
continue;
454457
MachineInstr *NewDV = buildDbgValueForSpill(
455458
*MBB, Before, *MISpilledOperands.first, FI, MISpilledOperands.second);
456459
assert(NewDV->getParent() == MBB && "dangling parent pointer");

0 commit comments

Comments
 (0)