[llvm] [AMDGPU] Disable s_setkill on gfx1250 (PR #153471)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 13 22:12:21 PDT 2025


https://github.com/rampitec updated https://github.com/llvm/llvm-project/pull/153471

>From 6df1c662d886594e4f9f8cf05b6d5c1be6e8a38c Mon Sep 17 00:00:00 2001
From: Stanislav Mekhanoshin <Stanislav.Mekhanoshin at amd.com>
Date: Wed, 13 Aug 2025 12:01:14 -0700
Subject: [PATCH] [AMDGPU] Disable s_setkill on gfx1250

---
 llvm/lib/Target/AMDGPU/SOPInstructions.td  | 4 +++-
 llvm/test/MC/AMDGPU/gfx1250_asm_sopp_err.s | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_sopp_err.s

diff --git a/llvm/lib/Target/AMDGPU/SOPInstructions.td b/llvm/lib/Target/AMDGPU/SOPInstructions.td
index c2f4dbfa247d1..a003a46191a87 100644
--- a/llvm/lib/Target/AMDGPU/SOPInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SOPInstructions.td
@@ -1665,7 +1665,9 @@ def S_WAITCNT_lds_direct : SPseudoInstSI<(outs), (ins)> {
 
 def S_SETHALT : SOPP_Pseudo <"s_sethalt" , (ins i32imm:$simm16), "$simm16",
     [(int_amdgcn_s_sethalt timm:$simm16)]>;
-def S_SETKILL : SOPP_Pseudo <"s_setkill" , (ins i16imm:$simm16), "$simm16">;
+def S_SETKILL : SOPP_Pseudo <"s_setkill" , (ins i16imm:$simm16), "$simm16"> {
+  let SubtargetPredicate = isNotGFX1250Plus;
+}
 
 // On SI the documentation says sleep for approximately 64 * low 2
 // bits, consistent with the reported maximum of 448. On VI the
diff --git a/llvm/test/MC/AMDGPU/gfx1250_asm_sopp_err.s b/llvm/test/MC/AMDGPU/gfx1250_asm_sopp_err.s
new file mode 100644
index 0000000000000..d151c9ac2f804
--- /dev/null
+++ b/llvm/test/MC/AMDGPU/gfx1250_asm_sopp_err.s
@@ -0,0 +1,4 @@
+// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx1250 -show-encoding %s 2>&1 | FileCheck --check-prefixes=GFX1250-ERR --implicit-check-not=error: -strict-whitespace %s
+
+s_setkill 0
+// GFX1250-ERR: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU



More information about the llvm-commits mailing list