-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[AMDGPU] New intrinsic llvm.amdgcn.pops.exiting.wave.id #89612
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
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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 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 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 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
34 changes: 34 additions & 0 deletions
34
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.pops.exiting.wave.id.ll
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 | ||
; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck %s -check-prefix=SDAG | ||
; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck %s -check-prefix=GFX9-GISEL | ||
; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck %s -check-prefix=SDAG | ||
; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1010 < %s | FileCheck %s -check-prefix=GFX10-GISEL | ||
|
||
define amdgpu_ps void @test(ptr addrspace(1) inreg %ptr) { | ||
; SDAG-LABEL: test: | ||
; SDAG: ; %bb.0: | ||
; SDAG-NEXT: s_mov_b32 s2, src_pops_exiting_wave_id | ||
; SDAG-NEXT: v_mov_b32_e32 v0, 0 | ||
; SDAG-NEXT: v_mov_b32_e32 v1, s2 | ||
; SDAG-NEXT: global_store_dword v0, v1, s[0:1] | ||
; SDAG-NEXT: s_endpgm | ||
; | ||
; GFX9-GISEL-LABEL: test: | ||
; GFX9-GISEL: ; %bb.0: | ||
; GFX9-GISEL-NEXT: s_mov_b32 s2, src_pops_exiting_wave_id | ||
; GFX9-GISEL-NEXT: v_mov_b32_e32 v0, s2 | ||
; GFX9-GISEL-NEXT: v_mov_b32_e32 v1, 0 | ||
; GFX9-GISEL-NEXT: global_store_dword v1, v0, s[0:1] | ||
; GFX9-GISEL-NEXT: s_endpgm | ||
; | ||
; GFX10-GISEL-LABEL: test: | ||
; GFX10-GISEL: ; %bb.0: | ||
; GFX10-GISEL-NEXT: s_mov_b32 s2, src_pops_exiting_wave_id | ||
; GFX10-GISEL-NEXT: v_mov_b32_e32 v1, 0 | ||
; GFX10-GISEL-NEXT: v_mov_b32_e32 v0, s2 | ||
; GFX10-GISEL-NEXT: global_store_dword v1, v0, s[0:1] | ||
; GFX10-GISEL-NEXT: s_endpgm | ||
%id = call i32 @llvm.amdgcn.pops.exiting.wave.id() | ||
store i32 %id, ptr addrspace(1) %ptr | ||
ret void | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO in a future patch: fold src_pops_exiting_wave_id into uses of s2. This might be tricky because the value of src_pops_exiting_wave_id is volatile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. As long as there's only a single use it may be fine.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another possible, but disgustingly dirty approach would be to expose it not as a load, but rather directly as an integer addition to an operand 🙃 But that'd definitely add some excessive responsibilities to it, especially since there are other ways the wave ID wraparound can be handled mathematically such as comparisons, and I don't know how unfriendly to the rest of the architecture that would be.