From ed30414b0a2a751bab3cf717bad98db6f699c29b Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Thu, 25 Sep 2025 09:40:54 +0100 Subject: [MachineStripDebug] Remove debug instructions from inside bundles (#160297) Some passes, like AMDGPU's SIInsertHardClauses, wrap sequences of instructions into bundles, and these bundles may end up with debug instructions in the middle. Assuming that this is allowed, this patch fixes MachineStripDebug to be able to remove these instructions from inside a bundle. --- llvm/lib/CodeGen/MachineStripDebug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineStripDebug.cpp') diff --git a/llvm/lib/CodeGen/MachineStripDebug.cpp b/llvm/lib/CodeGen/MachineStripDebug.cpp index ea291f64bff4..d54fe023a4a7 100644 --- a/llvm/lib/CodeGen/MachineStripDebug.cpp +++ b/llvm/lib/CodeGen/MachineStripDebug.cpp @@ -58,7 +58,7 @@ struct StripDebugMachineModule : public ModulePass { // preservation. Preserve it for now. if (MI.getNumOperands() > 1) { LLVM_DEBUG(dbgs() << "Removing debug instruction " << MI); - MBB.erase(&MI); + MBB.erase_instr(&MI); Changed |= true; continue; } -- cgit v1.2.3