Skip to content

Commit b953155

Browse files
committed
AMDGPU: Fix counting debug instructions in execz skip threshold
1 parent 2f0047a commit b953155

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ bool SIPreEmitPeephole::mustRetainExeczBranch(
320320
if (MI.isConditionalBranch())
321321
return true;
322322

323+
if (MI.isMetaInstruction())
324+
continue;
325+
323326
if (TII->hasUnwantedEffectsWhenEXECEmpty(MI))
324327
return true;
325328

llvm/test/CodeGen/AMDGPU/insert-skips-ignored-insts.mir

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
---
44

5-
# FIXME: RemoveShortExecBranches should not count dbg_value instructions.
65
# CHECK-LABEL: name: no_count_dbg_value
76
# CHECK: $vgpr1 = V_MOV_B32_e32 7, implicit $exec
87
# CHECK-NOT: S_CBRANCH_EXECZ
@@ -18,6 +17,11 @@ body: |
1817
successors: %bb.2
1918
$vgpr0 = V_MOV_B32_e32 0, implicit $exec
2019
DBG_VALUE
20+
DBG_VALUE
21+
DBG_VALUE
22+
DBG_VALUE
23+
DBG_VALUE
24+
DBG_VALUE
2125
2226
bb.2:
2327
$vgpr0 = V_MOV_B32_e32 1, implicit $exec

0 commit comments

Comments
 (0)