[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.
This commit is contained in:
parent
1034bb57ae
commit
ed30414b0a
@ -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;
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
# RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass si-insert-hard-clauses %s -o - | FileCheck %s
|
||||
# RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs -run-pass si-insert-hard-clauses %s -o - | FileCheck %s -check-prefix=GFX11
|
||||
# RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs -run-pass si-insert-hard-clauses %s -o - | FileCheck %s -check-prefix=GFX12
|
||||
# RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs -run-pass si-insert-hard-clauses %s -o - -debugify-and-strip-all-safe | FileCheck %s -check-prefix=GFX12
|
||||
|
||||
---
|
||||
name: nop1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user