[llvm] [AMDGPU] Remove s_subvector_loop_begin/end for GFX12 (PR #74451)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 03:27:26 PST 2023


https://github.com/jayfoad created https://github.com/llvm/llvm-project/pull/74451

None

>From 301bc3cbc2f21ae4eb49e4442cd118086a8fa88e Mon Sep 17 00:00:00 2001
From: Jay Foad <jay.foad at amd.com>
Date: Tue, 29 Nov 2022 16:58:58 +0000
Subject: [PATCH] [AMDGPU] Remove s_subvector_loop_begin/end for GFX12

---
 llvm/lib/Target/AMDGPU/SOPInstructions.td |  4 ++++
 llvm/test/MC/AMDGPU/gfx12_unsupported.s   | 11 +++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 llvm/test/MC/AMDGPU/gfx12_unsupported.s

diff --git a/llvm/lib/Target/AMDGPU/SOPInstructions.td b/llvm/lib/Target/AMDGPU/SOPInstructions.td
index 87f64913c02d0..bff42dbfddc69 100644
--- a/llvm/lib/Target/AMDGPU/SOPInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SOPInstructions.td
@@ -1086,10 +1086,14 @@ let SubtargetPredicate = isGFX10Plus in {
       "$simm16"> {
     let has_sdst = 0;
   }
+} // End SubtargetPredicate = isGFX10Plus
 
+let SubtargetPredicate = isGFX10GFX11 in {
   def S_SUBVECTOR_LOOP_BEGIN : SOPK_32_BR<"s_subvector_loop_begin">;
   def S_SUBVECTOR_LOOP_END   : SOPK_32_BR<"s_subvector_loop_end">;
+} // End SubtargetPredicate = isGFX10GFX11
 
+let SubtargetPredicate = isGFX10Plus in {
   def S_WAITCNT_VSCNT   : SOPK_WAITCNT<"s_waitcnt_vscnt">;
   def S_WAITCNT_VMCNT   : SOPK_WAITCNT<"s_waitcnt_vmcnt">;
   def S_WAITCNT_EXPCNT  : SOPK_WAITCNT<"s_waitcnt_expcnt">;
diff --git a/llvm/test/MC/AMDGPU/gfx12_unsupported.s b/llvm/test/MC/AMDGPU/gfx12_unsupported.s
new file mode 100644
index 0000000000000..c9eb29c18a1a6
--- /dev/null
+++ b/llvm/test/MC/AMDGPU/gfx12_unsupported.s
@@ -0,0 +1,11 @@
+// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1200 %s 2>&1 | FileCheck --implicit-check-not=error: %s
+
+//===----------------------------------------------------------------------===//
+// Unsupported instructions.
+//===----------------------------------------------------------------------===//
+
+s_subvector_loop_begin s0, 0x1234
+// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU
+
+s_subvector_loop_end s0, 0x1234
+// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU



More information about the llvm-commits mailing list