diff options
| author | Josh Stone <jistone@redhat.com> | 2023-01-03 16:04:45 -0800 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2023-01-05 20:41:11 -0800 |
| commit | 87f57f459e7acbb00a6ca4ee6dec6014c5a97e07 (patch) | |
| tree | afdacfb140533d02a8582b797fd0c4aea4d978ad /llvm/lib/CodeGen/RegAllocFast.cpp | |
| parent | 143ec502e9859141e9d340ed59046dad0fc4ee6f (diff) | |
[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 https://github.com/llvm/llvm-project/issues/59172
Reviewed By: StephenTozer
Differential Revision: https://reviews.llvm.org/D139590
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocFast.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/RegAllocFast.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp index 81f5a8219e05..fdd8aa9b37f8 100644 --- a/llvm/lib/CodeGen/RegAllocFast.cpp +++ b/llvm/lib/CodeGen/RegAllocFast.cpp @@ -451,6 +451,9 @@ void RegAllocFast::spill(MachineBasicBlock::iterator Before, Register VirtReg, SpilledOperandsMap[MO->getParent()].push_back(MO); for (auto MISpilledOperands : SpilledOperandsMap) { MachineInstr &DBG = *MISpilledOperands.first; + // We don't have enough support for tracking operands of DBG_VALUE_LISTs. + if (DBG.isDebugValueList()) + continue; MachineInstr *NewDV = buildDbgValueForSpill( *MBB, Before, *MISpilledOperands.first, FI, MISpilledOperands.second); assert(NewDV->getParent() == MBB && "dangling parent pointer"); |
