Skip to content

Commit 3cb2174

Browse files
authored
[AMDGPU] Skip debug uses in SIPeepholeSDWA (#160092)
1 parent 87129cf commit 3cb2174

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,8 @@ void SIPeepholeSDWA::pseudoOpConvertToVOP2(MachineInstr &MI,
10291029
MachineOperand *CarryOut = TII->getNamedOperand(MISucc, AMDGPU::OpName::sdst);
10301030
if (!CarryOut)
10311031
return;
1032-
if (!MRI->hasOneUse(CarryIn->getReg()) || !MRI->use_empty(CarryOut->getReg()))
1032+
if (!MRI->hasOneNonDBGUse(CarryIn->getReg()) ||
1033+
!MRI->use_nodbg_empty(CarryOut->getReg()))
10331034
return;
10341035
// Make sure VCC or its subregs are dead before MI.
10351036
MachineBasicBlock &MBB = *MI.getParent();

llvm/test/CodeGen/AMDGPU/v_add_u64_pseudo_sdwa.ll

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
22
; RUN: llc -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck -check-prefixes=GFX9 %s
3+
; RUN: llc -mtriple=amdgcn -mcpu=gfx900 < %s -debugify-and-strip-all-safe | FileCheck -check-prefixes=GFX9 %s
4+
35
define amdgpu_kernel void @sdwa_test() local_unnamed_addr #0 {
46
; GFX9-LABEL: sdwa_test:
57
; GFX9: ; %bb.0: ; %bb
@@ -21,7 +23,6 @@ bb:
2123
ret void
2224
}
2325

24-
2526
define amdgpu_kernel void @test_add_co_sdwa(ptr addrspace(1) %arg, ptr addrspace(1) %arg1) #0 {
2627
; GFX9-LABEL: test_add_co_sdwa:
2728
; GFX9: ; %bb.0: ; %bb
@@ -48,6 +49,3 @@ bb:
4849
store i64 %tmp9, ptr addrspace(1) %tmp7, align 8
4950
ret void
5051
}
51-
52-
53-
declare i32 @llvm.amdgcn.workitem.id.x()

0 commit comments

Comments
 (0)