Skip to content

Conversation

rampitec
Copy link
Collaborator

No description provided.

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@rampitec rampitec requested a review from shiltian August 25, 2025 21:53
@rampitec rampitec marked this pull request as ready for review August 25, 2025 21:53
@llvmbot
Copy link
Member

llvmbot commented Aug 25, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Stanislav Mekhanoshin (rampitec)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/155317.diff

2 Files Affected:

  • (added) llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.waitcnt_gfx1250.ll (+10)
  • (modified) llvm/test/CodeGen/AMDGPU/wait-before-stores-with-scope_sys.mir (+38-24)
diff --git a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.waitcnt_gfx1250.ll b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.waitcnt_gfx1250.ll
new file mode 100644
index 0000000000000..f01019968904b
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.waitcnt_gfx1250.ll
@@ -0,0 +1,10 @@
+; RUN: not --crash llc -mtriple=amdgcn -mcpu=gfx1250 < %s 2>&1 | FileCheck -check-prefix=ERR %s
+
+; ERR: LLVM ERROR: Cannot select: intrinsic %llvm.amdgcn.s.waitcnt
+
+define amdgpu_kernel void @test_waitcnt_builtin() {
+  call void @llvm.amdgcn.s.waitcnt(i32 0)
+  ret void
+}
+
+declare void @llvm.amdgcn.s.waitcnt(i32)
diff --git a/llvm/test/CodeGen/AMDGPU/wait-before-stores-with-scope_sys.mir b/llvm/test/CodeGen/AMDGPU/wait-before-stores-with-scope_sys.mir
index acf8bd3a6ab56..1e9d4dda61bf3 100644
--- a/llvm/test/CodeGen/AMDGPU/wait-before-stores-with-scope_sys.mir
+++ b/llvm/test/CodeGen/AMDGPU/wait-before-stores-with-scope_sys.mir
@@ -1,5 +1,6 @@
 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
-# RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -run-pass=si-memory-legalizer  %s -o - | FileCheck -check-prefix=GFX12 %s
+# RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -run-pass=si-memory-legalizer %s -o - | FileCheck --check-prefix=GFX1200 %s
+# RUN: llc -mtriple=amdgcn -mcpu=gfx1250 -run-pass=si-memory-legalizer %s -o - | FileCheck --check-prefix=GFX1250 %s
 
 ---
 name: intrinsic_store_system_scope
@@ -7,17 +8,23 @@ body: |
   bb.0:
     liveins: $sgpr0, $sgpr1, $sgpr2, $sgpr3, $sgpr4, $vgpr0, $vgpr1, $vgpr2
 
-    ; GFX12-LABEL: name: intrinsic_store_system_scope
-    ; GFX12: liveins: $sgpr0, $sgpr1, $sgpr2, $sgpr3, $sgpr4, $vgpr0, $vgpr1, $vgpr2
-    ; GFX12-NEXT: {{  $}}
-    ; GFX12-NEXT: S_WAIT_LOADCNT_soft 0
-    ; GFX12-NEXT: S_WAIT_SAMPLECNT_soft 0
-    ; GFX12-NEXT: S_WAIT_BVHCNT_soft 0
-    ; GFX12-NEXT: S_WAIT_KMCNT_soft 0
-    ; GFX12-NEXT: S_WAIT_STORECNT_soft 0
-    ; GFX12-NEXT: BUFFER_STORE_DWORD_VBUFFER_BOTHEN_exact killed renamable $vgpr0, killed renamable $vgpr1_vgpr2, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 0, 24, 0, implicit $exec :: (dereferenceable store (s32), align 1, addrspace 8)
-    ; GFX12-NEXT: S_ENDPGM 0
-    BUFFER_STORE_DWORD_VBUFFER_BOTHEN_exact killed renamable $vgpr0, killed renamable $vgpr1_vgpr2, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 0, 24, 0, implicit $exec :: (dereferenceable store (s32), align 1, addrspace 8)
+    ; GFX1200-LABEL: name: intrinsic_store_system_scope
+    ; GFX1200: liveins: $sgpr0, $sgpr1, $sgpr2, $sgpr3, $sgpr4, $vgpr0, $vgpr1, $vgpr2
+    ; GFX1200-NEXT: {{  $}}
+    ; GFX1200-NEXT: S_WAIT_LOADCNT_soft 0
+    ; GFX1200-NEXT: S_WAIT_SAMPLECNT_soft 0
+    ; GFX1200-NEXT: S_WAIT_BVHCNT_soft 0
+    ; GFX1200-NEXT: S_WAIT_KMCNT_soft 0
+    ; GFX1200-NEXT: S_WAIT_STORECNT_soft 0
+    ; GFX1200-NEXT: BUFFER_STORE_DWORD_VBUFFER_BOTHEN_exact killed renamable $vgpr0, killed renamable $vgpr2_vgpr3, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 0, 24, 0, implicit $exec :: (dereferenceable store (s32), align 1, addrspace 8)
+    ; GFX1200-NEXT: S_ENDPGM 0
+    ;
+    ; GFX1250-LABEL: name: intrinsic_store_system_scope
+    ; GFX1250: liveins: $sgpr0, $sgpr1, $sgpr2, $sgpr3, $sgpr4, $vgpr0, $vgpr1, $vgpr2
+    ; GFX1250-NEXT: {{  $}}
+    ; GFX1250-NEXT: BUFFER_STORE_DWORD_VBUFFER_BOTHEN_exact killed renamable $vgpr0, killed renamable $vgpr2_vgpr3, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 0, 24, 0, implicit $exec :: (dereferenceable store (s32), align 1, addrspace 8)
+    ; GFX1250-NEXT: S_ENDPGM 0
+    BUFFER_STORE_DWORD_VBUFFER_BOTHEN_exact killed renamable $vgpr0, killed renamable $vgpr2_vgpr3, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 0, 24, 0, implicit $exec :: (dereferenceable store (s32), align 1, addrspace 8)
     S_ENDPGM 0
 ...
 
@@ -27,17 +34,24 @@ body: |
   bb.0:
     liveins: $vgpr0, $vgpr1, $vgpr2
 
-    ; GFX12-LABEL: name: generic_store_volatile
-    ; GFX12: liveins: $vgpr0, $vgpr1, $vgpr2
-    ; GFX12-NEXT: {{  $}}
-    ; GFX12-NEXT: S_WAIT_LOADCNT_soft 0
-    ; GFX12-NEXT: S_WAIT_SAMPLECNT_soft 0
-    ; GFX12-NEXT: S_WAIT_BVHCNT_soft 0
-    ; GFX12-NEXT: S_WAIT_KMCNT_soft 0
-    ; GFX12-NEXT: S_WAIT_STORECNT_soft 0
-    ; GFX12-NEXT: GLOBAL_STORE_DWORD killed renamable $vgpr1_vgpr2, killed renamable $vgpr0, 0, 24, implicit $exec :: (volatile store (s32), addrspace 1)
-    ; GFX12-NEXT: S_WAIT_STORECNT_soft 0
-    ; GFX12-NEXT: S_ENDPGM 0
-    GLOBAL_STORE_DWORD killed renamable $vgpr1_vgpr2, killed renamable $vgpr0, 0, 0, implicit $exec :: (volatile store (s32), addrspace 1)
+    ; GFX1200-LABEL: name: generic_store_volatile
+    ; GFX1200: liveins: $vgpr0, $vgpr1, $vgpr2
+    ; GFX1200-NEXT: {{  $}}
+    ; GFX1200-NEXT: S_WAIT_LOADCNT_soft 0
+    ; GFX1200-NEXT: S_WAIT_SAMPLECNT_soft 0
+    ; GFX1200-NEXT: S_WAIT_BVHCNT_soft 0
+    ; GFX1200-NEXT: S_WAIT_KMCNT_soft 0
+    ; GFX1200-NEXT: S_WAIT_STORECNT_soft 0
+    ; GFX1200-NEXT: GLOBAL_STORE_DWORD killed renamable $vgpr2_vgpr3, killed renamable $vgpr0, 0, 24, implicit $exec :: (volatile store (s32), addrspace 1)
+    ; GFX1200-NEXT: S_WAIT_STORECNT_soft 0
+    ; GFX1200-NEXT: S_ENDPGM 0
+    ;
+    ; GFX1250-LABEL: name: generic_store_volatile
+    ; GFX1250: liveins: $vgpr0, $vgpr1, $vgpr2
+    ; GFX1250-NEXT: {{  $}}
+    ; GFX1250-NEXT: GLOBAL_STORE_DWORD killed renamable $vgpr2_vgpr3, killed renamable $vgpr0, 0, 24, implicit $exec :: (volatile store (s32), addrspace 1)
+    ; GFX1250-NEXT: S_WAIT_STORECNT_soft 0
+    ; GFX1250-NEXT: S_ENDPGM 0
+    GLOBAL_STORE_DWORD killed renamable $vgpr2_vgpr3, killed renamable $vgpr0, 0, 0, implicit $exec :: (volatile store (s32), addrspace 1)
     S_ENDPGM 0
 ...

@rampitec rampitec merged commit 94e4ef5 into main Aug 25, 2025
13 checks passed
@rampitec rampitec deleted the users/rampitec/08-25-_amdgpu_gfx1250_waitcnt_related_codegen_tests_update._nfc branch August 25, 2025 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants