-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[AMDGPU] Add intrinsic exposing s_alloc_vgpr #163951
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
Open
rovka
wants to merge
5
commits into
main
Choose a base branch
from
users/rovka/alloc-vgpr-intrinsic
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+103
−2
Open
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
96b38fb
[AMDGPU] Add intrinsic exposing s_alloc_vgpr
rovka a429b95
Silence warning
rovka b3bb4a5
Address review comments
rovka 56891f1
Merge branch 'main' into users/rovka/alloc-vgpr-intrinsic
rovka 7a8d89d
Merge branch 'main' into users/rovka/alloc-vgpr-intrinsic
rovka 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
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,59 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6 | ||
| ; RUN: llc -global-isel=1 -mtriple=amdgcn--amdpal -mcpu=gfx1250 < %s | FileCheck %s --check-prefix=GISEL | ||
| ; RUN: llc -global-isel=0 -mtriple=amdgcn--amdpal -mcpu=gfx1250 < %s | FileCheck %s --check-prefix=DAGISEL | ||
|
|
||
| declare i1 @llvm.amdgcn.s.alloc.vgpr(i32) | ||
|
|
||
| define amdgpu_cs void @test_alloc_vreg_const(ptr addrspace(1) %out) #0 { | ||
| ; GISEL-LABEL: test_alloc_vreg_const: | ||
| ; GISEL: ; %bb.0: ; %entry | ||
| ; GISEL-NEXT: s_alloc_vgpr 45 | ||
| ; GISEL-NEXT: s_cselect_b32 s0, 1, 0 | ||
| ; GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1) | ||
| ; GISEL-NEXT: s_and_b32 s0, s0, 1 | ||
| ; GISEL-NEXT: v_mov_b32_e32 v2, s0 | ||
| ; GISEL-NEXT: global_store_b32 v[0:1], v2, off | ||
| ; GISEL-NEXT: s_endpgm | ||
| ; | ||
| ; DAGISEL-LABEL: test_alloc_vreg_const: | ||
| ; DAGISEL: ; %bb.0: ; %entry | ||
| ; DAGISEL-NEXT: s_alloc_vgpr 45 | ||
| ; DAGISEL-NEXT: s_cselect_b32 s0, -1, 0 | ||
| ; DAGISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | ||
| ; DAGISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1, s0 | ||
| ; DAGISEL-NEXT: global_store_b32 v[0:1], v2, off | ||
| ; DAGISEL-NEXT: s_endpgm | ||
| entry: | ||
| %scc = call i1 @llvm.amdgcn.s.alloc.vgpr(i32 45) | ||
| %sel = select i1 %scc, i32 1, i32 0 | ||
| store i32 %sel, ptr addrspace(1) %out | ||
| ret void | ||
| } | ||
|
|
||
| define amdgpu_cs void @test_alloc_vreg_var(i32 inreg %n, ptr addrspace(1) %out) #0 { | ||
| ; GISEL-LABEL: test_alloc_vreg_var: | ||
| ; GISEL: ; %bb.0: ; %entry | ||
| ; GISEL-NEXT: s_alloc_vgpr s0 | ||
| ; GISEL-NEXT: s_cselect_b32 s0, 1, 0 | ||
| ; GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1) | ||
| ; GISEL-NEXT: s_and_b32 s0, s0, 1 | ||
| ; GISEL-NEXT: v_mov_b32_e32 v2, s0 | ||
| ; GISEL-NEXT: global_store_b32 v[0:1], v2, off | ||
| ; GISEL-NEXT: s_endpgm | ||
| ; | ||
| ; DAGISEL-LABEL: test_alloc_vreg_var: | ||
| ; DAGISEL: ; %bb.0: ; %entry | ||
| ; DAGISEL-NEXT: s_alloc_vgpr s0 | ||
| ; DAGISEL-NEXT: s_cselect_b32 s0, -1, 0 | ||
| ; DAGISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | ||
| ; DAGISEL-NEXT: v_cndmask_b32_e64 v2, 0, 1, s0 | ||
| ; DAGISEL-NEXT: global_store_b32 v[0:1], v2, off | ||
| ; DAGISEL-NEXT: s_endpgm | ||
| entry: | ||
| %scc = call i1 @llvm.amdgcn.s.alloc.vgpr(i32 %n) | ||
| %sel = select i1 %scc, i32 1, i32 0 | ||
| store i32 %sel, ptr addrspace(1) %out | ||
| ret void | ||
| } | ||
|
|
||
| attributes #0 = { "amdgpu-dynamic-vgpr-block-sze" = "16" } |
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.
Uh oh!
There was an error while loading. Please reload this page.