Skip to content

Commit f8311a3

Browse files
committed
[AMDGPU] Skip debug instructions when eliminating S_SET_GPR_IDX_ON/OFF
1 parent c80d495 commit f8311a3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ bool SIPreEmitPeephole::optimizeSetGPR(MachineInstr &First,
299299
for (MachineBasicBlock::instr_iterator I = std::next(First.getIterator()),
300300
E = MI.getIterator();
301301
I != E; ++I) {
302-
if (I->isBundle())
302+
if (I->isBundle() || I->isDebugInstr())
303303
continue;
304304
switch (I->getOpcode()) {
305305
case AMDGPU::S_SET_GPR_IDX_MODE:

llvm/test/CodeGen/AMDGPU/set-gpr-idx-peephole.mir

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
22
# RUN: llc -mtriple=amdgcn -mcpu=gfx900 -run-pass si-pre-emit-peephole -verify-machineinstrs -o - %s | FileCheck -check-prefix=GCN %s -implicit-check-not=S_SET_GPR_IDX
3+
# RUN: llc -mtriple=amdgcn -mcpu=gfx900 -run-pass si-pre-emit-peephole -verify-machineinstrs -o - %s -debugify-and-strip-all-safe | FileCheck -check-prefix=GCN %s -implicit-check-not=S_SET_GPR_IDX
34
# RUN: llc -mtriple=amdgcn -mcpu=gfx900 -passes si-pre-emit-peephole -o - %s | FileCheck -check-prefix=GCN %s -implicit-check-not=S_SET_GPR_IDX
45

56
---

0 commit comments

Comments
 (0)