-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[AMDGPU][InsertWaitCnts] Add test for global_wb/inv/wbinv tracking #135339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Pierre-vh
merged 1 commit into
main
from
users/pierre-vh/insertwaitcnt-wbinv-track-test
Apr 22, 2025
Merged
[AMDGPU][InsertWaitCnts] Add test for global_wb/inv/wbinv tracking #135339
Pierre-vh
merged 1 commit into
main
from
users/pierre-vh/insertwaitcnt-wbinv-track-test
Apr 22, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@llvm/pr-subscribers-backend-amdgpu Author: Pierre van Houtryve (Pierre-vh) ChangesFull diff: https://github.com/llvm/llvm-project/pull/135339.diff 1 Files Affected:
diff --git a/llvm/test/CodeGen/AMDGPU/insert-waitcnts-gfx12-wbinv.mir b/llvm/test/CodeGen/AMDGPU/insert-waitcnts-gfx12-wbinv.mir
new file mode 100644
index 0000000000000..6758a43aedd3c
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/insert-waitcnts-gfx12-wbinv.mir
@@ -0,0 +1,129 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
+# RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -run-pass si-insert-waitcnts -o - %s | FileCheck %s
+
+
+# Check storecnt is not eliminated after global_wb/wbinv or
+# loadcnt after inv.
+---
+
+name: wb_storecnt
+body: |
+ ; CHECK-LABEL: name: wb_storecnt
+ ; CHECK: bb.0:
+ ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: S_WAIT_LOADCNT_DSCNT 0
+ ; CHECK-NEXT: S_WAIT_EXPCNT 0
+ ; CHECK-NEXT: S_WAIT_SAMPLECNT 0
+ ; CHECK-NEXT: S_WAIT_BVHCNT 0
+ ; CHECK-NEXT: S_WAIT_KMCNT 0
+ ; CHECK-NEXT: S_WAIT_STORECNT 0
+ ; CHECK-NEXT: S_CMP_EQ_U32 renamable $sgpr1, 0, implicit-def $scc
+ ; CHECK-NEXT: S_CBRANCH_SCC1 %bb.2, implicit killed $scc
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: bb.1:
+ ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: GLOBAL_WB 16, implicit $exec
+ ; CHECK-NEXT: GLOBAL_STORE_DWORD_SADDR renamable $vgpr0, renamable $vgpr1, renamable $sgpr2_sgpr3, 0, 16, implicit $exec
+ ; CHECK-NEXT: S_CBRANCH_SCC0 %bb.1, implicit killed $scc
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: bb.2:
+ ; CHECK-NEXT: S_ENDPGM 0
+ bb.0:
+ S_WAIT_LOADCNT_soft 0
+ S_WAIT_STORECNT_soft 0
+ S_WAIT_DSCNT_soft 0
+ S_CMP_EQ_U32 renamable $sgpr1, 0, implicit-def $scc
+ S_CBRANCH_SCC1 %bb.2, implicit killed $scc
+ bb.1:
+ GLOBAL_WB 16, implicit $exec
+ S_WAIT_LOADCNT_soft 0
+ S_WAIT_STORECNT_soft 0
+ GLOBAL_STORE_DWORD_SADDR renamable $vgpr0, renamable $vgpr1, renamable $sgpr2_sgpr3, 0, 16, implicit $exec
+ S_CBRANCH_SCC0 %bb.1, implicit killed $scc
+ bb.2:
+ S_ENDPGM 0
+...
+---
+
+name: wbinv_storecnt
+body: |
+ ; CHECK-LABEL: name: wbinv_storecnt
+ ; CHECK: bb.0:
+ ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: S_WAIT_LOADCNT_DSCNT 0
+ ; CHECK-NEXT: S_WAIT_EXPCNT 0
+ ; CHECK-NEXT: S_WAIT_SAMPLECNT 0
+ ; CHECK-NEXT: S_WAIT_BVHCNT 0
+ ; CHECK-NEXT: S_WAIT_KMCNT 0
+ ; CHECK-NEXT: S_WAIT_STORECNT 0
+ ; CHECK-NEXT: S_CMP_EQ_U32 renamable $sgpr1, 0, implicit-def $scc
+ ; CHECK-NEXT: S_CBRANCH_SCC1 %bb.2, implicit killed $scc
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: bb.1:
+ ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: GLOBAL_WBINV 16, implicit $exec
+ ; CHECK-NEXT: GLOBAL_STORE_DWORD_SADDR renamable $vgpr0, renamable $vgpr1, renamable $sgpr2_sgpr3, 0, 16, implicit $exec
+ ; CHECK-NEXT: S_CBRANCH_SCC0 %bb.1, implicit killed $scc
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: bb.2:
+ ; CHECK-NEXT: S_ENDPGM 0
+ bb.0:
+ S_WAIT_LOADCNT_soft 0
+ S_WAIT_STORECNT_soft 0
+ S_WAIT_DSCNT_soft 0
+ S_CMP_EQ_U32 renamable $sgpr1, 0, implicit-def $scc
+ S_CBRANCH_SCC1 %bb.2, implicit killed $scc
+ bb.1:
+ GLOBAL_WBINV 16, implicit $exec
+ S_WAIT_LOADCNT_soft 0
+ S_WAIT_STORECNT_soft 0
+ GLOBAL_STORE_DWORD_SADDR renamable $vgpr0, renamable $vgpr1, renamable $sgpr2_sgpr3, 0, 16, implicit $exec
+ S_CBRANCH_SCC0 %bb.1, implicit killed $scc
+ bb.2:
+ S_ENDPGM 0
+...
+---
+
+name: inv_loadcnt
+body: |
+ ; CHECK-LABEL: name: inv_loadcnt
+ ; CHECK: bb.0:
+ ; CHECK-NEXT: successors: %bb.2(0x40000000), %bb.1(0x40000000)
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: S_WAIT_LOADCNT_DSCNT 0
+ ; CHECK-NEXT: S_WAIT_EXPCNT 0
+ ; CHECK-NEXT: S_WAIT_SAMPLECNT 0
+ ; CHECK-NEXT: S_WAIT_BVHCNT 0
+ ; CHECK-NEXT: S_WAIT_KMCNT 0
+ ; CHECK-NEXT: S_WAIT_STORECNT 0
+ ; CHECK-NEXT: S_CMP_EQ_U32 renamable $sgpr1, 0, implicit-def $scc
+ ; CHECK-NEXT: S_CBRANCH_SCC1 %bb.2, implicit killed $scc
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: bb.1:
+ ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: GLOBAL_INV 16, implicit $exec
+ ; CHECK-NEXT: GLOBAL_STORE_DWORD_SADDR renamable $vgpr0, renamable $vgpr1, renamable $sgpr2_sgpr3, 0, 16, implicit $exec
+ ; CHECK-NEXT: S_CBRANCH_SCC0 %bb.1, implicit killed $scc
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: bb.2:
+ ; CHECK-NEXT: S_ENDPGM 0
+ bb.0:
+ S_WAIT_LOADCNT_soft 0
+ S_WAIT_STORECNT_soft 0
+ S_WAIT_DSCNT_soft 0
+ S_CMP_EQ_U32 renamable $sgpr1, 0, implicit-def $scc
+ S_CBRANCH_SCC1 %bb.2, implicit killed $scc
+ bb.1:
+ GLOBAL_INV 16, implicit $exec
+ S_WAIT_LOADCNT_soft 0
+ S_WAIT_STORECNT_soft 0
+ GLOBAL_STORE_DWORD_SADDR renamable $vgpr0, renamable $vgpr1, renamable $sgpr2_sgpr3, 0, 16, implicit $exec
+ S_CBRANCH_SCC0 %bb.1, implicit killed $scc
+ bb.2:
+ S_ENDPGM 0
+...
|
tgymnich
approved these changes
Apr 11, 2025
arsenm
approved these changes
Apr 11, 2025
2b3bca6
to
1e2c03a
Compare
Merge activity
|
1e2c03a
to
b1422e7
Compare
b1422e7
to
c8e9def
Compare
IanWood1
pushed a commit
to IanWood1/llvm-project
that referenced
this pull request
May 6, 2025
IanWood1
pushed a commit
to IanWood1/llvm-project
that referenced
this pull request
May 6, 2025
IanWood1
pushed a commit
to IanWood1/llvm-project
that referenced
this pull request
May 6, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.