[llvm] 3cb2174 - [AMDGPU] Skip debug uses in SIPeepholeSDWA (#160092)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 22 06:40:04 PDT 2025
Author: Jay Foad
Date: 2025-09-22T14:40:00+01:00
New Revision: 3cb21742193663143800bd86284e0cf395e0cff2
URL: https://github.com/llvm/llvm-project/commit/3cb21742193663143800bd86284e0cf395e0cff2
DIFF: https://github.com/llvm/llvm-project/commit/3cb21742193663143800bd86284e0cf395e0cff2.diff
LOG: [AMDGPU] Skip debug uses in SIPeepholeSDWA (#160092)
Added:
Modified:
llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
llvm/test/CodeGen/AMDGPU/v_add_u64_pseudo_sdwa.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp b/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
index 857cb91a977f3..afe76e1ca74f2 100644
--- a/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
+++ b/llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp
@@ -1029,7 +1029,8 @@ void SIPeepholeSDWA::pseudoOpConvertToVOP2(MachineInstr &MI,
MachineOperand *CarryOut = TII->getNamedOperand(MISucc, AMDGPU::OpName::sdst);
if (!CarryOut)
return;
- if (!MRI->hasOneUse(CarryIn->getReg()) || !MRI->use_empty(CarryOut->getReg()))
+ if (!MRI->hasOneNonDBGUse(CarryIn->getReg()) ||
+ !MRI->use_nodbg_empty(CarryOut->getReg()))
return;
// Make sure VCC or its subregs are dead before MI.
MachineBasicBlock &MBB = *MI.getParent();
diff --git a/llvm/test/CodeGen/AMDGPU/v_add_u64_pseudo_sdwa.ll b/llvm/test/CodeGen/AMDGPU/v_add_u64_pseudo_sdwa.ll
index f95bc0b2f1cb6..d56f1f321371d 100644
--- a/llvm/test/CodeGen/AMDGPU/v_add_u64_pseudo_sdwa.ll
+++ b/llvm/test/CodeGen/AMDGPU/v_add_u64_pseudo_sdwa.ll
@@ -1,5 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck -check-prefixes=GFX9 %s
+; RUN: llc -mtriple=amdgcn -mcpu=gfx900 < %s -debugify-and-strip-all-safe | FileCheck -check-prefixes=GFX9 %s
+
define amdgpu_kernel void @sdwa_test() local_unnamed_addr #0 {
; GFX9-LABEL: sdwa_test:
; GFX9: ; %bb.0: ; %bb
@@ -21,7 +23,6 @@ bb:
ret void
}
-
define amdgpu_kernel void @test_add_co_sdwa(ptr addrspace(1) %arg, ptr addrspace(1) %arg1) #0 {
; GFX9-LABEL: test_add_co_sdwa:
; GFX9: ; %bb.0: ; %bb
@@ -48,6 +49,3 @@ bb:
store i64 %tmp9, ptr addrspace(1) %tmp7, align 8
ret void
}
-
-
-declare i32 @llvm.amdgcn.workitem.id.x()
More information about the llvm-commits
mailing list