From ad68e5d56c0258cf6c20657bebc9ef0ad5b20551 Mon Sep 17 00:00:00 2001 From: Scott Linder Date: Thu, 18 Sep 2025 10:47:07 -0400 Subject: [LiveDebugVariables] Use bundle-aware iterators consistently (#159471) Most of the pass works in terms of MachineBasicBlock::iterator (MachineInstrBundleIterator), but here one is constructed from an arbitrary instruction which may be within a bundle, causing an assertion. --- llvm/lib/CodeGen/LiveDebugVariables.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp') diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index b049491..001ba52 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp @@ -1973,8 +1973,8 @@ void LiveDebugVariables::LDVImpl::emitDebugValues(VirtRegMap *VRM) { if (MachineInstr *Pos = Slots->getInstructionFromIndex(Idx)) { // Insert at the end of any debug instructions. - auto PostDebug = std::next(Pos->getIterator()); - PostDebug = skipDebugInstructionsForward(PostDebug, MBB->instr_end()); + auto PostDebug = std::next(MachineBasicBlock::iterator(Pos)); + PostDebug = skipDebugInstructionsForward(PostDebug, MBB->end()); EmitInstsHere(PostDebug); } else { // Insert position disappeared; walk forwards through slots until we -- cgit v1.1