-
Notifications
You must be signed in to change notification settings - Fork 15.4k
AMDGPU gfx12: Add _dvgpr$ symbols for dynamic VGPRs #148251
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 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8d0fb2e
AMDGPU gfx12: Add _dvgpr$ symbols for dynamic VGPRs
trenouf ca7d1ca
Fix rebase mix-up
trenouf f55bfa5
Various fixes
trenouf 1d1b80a
Document _dvgpr$ symbol
trenouf 3adb165
Review comments
trenouf 6b20af2
Change 'unable to resolve' error to unreachable as it cannot happen
trenouf f31ae93
Merge branch 'main' into dvgpr-sym
trenouf 251ab04
Add test for too many vgprs on anon func. Use divideCeil
trenouf a8ac4cc
Merge branch 'main' into dvgpr-sym
trenouf 1487d85
Fix tests for #151672 change
trenouf 14cc731
Merge branch 'main' into dvgpr-sym
trenouf 78f7dc1
Merge branch 'main' into dvgpr-sym
trenouf 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,62 @@ | ||
| ; Test generation of _dvgpr$ symbol for an amdgpu_cs_chain function with +dynamic-vgpr. | ||
|
|
||
| ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1200 -asm-verbose=0 < %s | FileCheck -check-prefixes=DVGPR %s | ||
| ; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1200 < %s | FileCheck -check-prefixes=DVGPR %s | ||
|
|
||
| ; DVGPR-LABEL: func: | ||
| ; DVGPR: .Ltmp0: | ||
| ; DVGPR: .set _dvgpr$func, .Ltmp0+{{[0-9]+}} | ||
| ; Function with 0 VGPRs, which counts as 1 block. | ||
| ; | ||
| ; DVGPR-LABEL: func0: | ||
| ; DVGPR: .set _dvgpr$func0, func0+0 | ||
| ; | ||
| define amdgpu_cs_chain void @func0() #0 { | ||
| ret void | ||
| } | ||
|
|
||
| ; Function with 21 VGPRs, which is 2 blocks. | ||
| ; | ||
| ; DVGPR-LABEL: func21: | ||
| ; DVGPR: .set _dvgpr$func21, func21+8 | ||
| ; | ||
| define amdgpu_cs_chain void @func21(<21 x float> %arg) #0 { | ||
| ret void | ||
| } | ||
|
|
||
| ; Anonymous function with 87 VGPRs, which is 6 blocks. | ||
| ; | ||
| ; DVGPR: [[FUNC87:__unnamed[^:]*]]: | ||
| ; DVGPR: .set _dvgpr$[[FUNC87]], [[FUNC87]]+40 | ||
| ; | ||
| define amdgpu_cs_chain void @0(<87 x float> %arg) #0 { | ||
| ret void | ||
| } | ||
|
|
||
| define amdgpu_cs_chain void @func() #0 { | ||
| ; Function with 128 VGPRs, which is 8 blocks. | ||
| ; | ||
| ; DVGPR-LABEL: func128: | ||
| ; DVGPR: .set _dvgpr$func128, func128+56 | ||
| ; | ||
| define amdgpu_cs_chain void @func128(<128 x float> %arg) #0 { | ||
| %vec87 = shufflevector <128 x float> %arg, <128 x float> %arg, <87 x i32> splat(i32 0) | ||
| tail call void @0(<87 x float> %vec87) | ||
| ret void | ||
| } | ||
| attributes #0 = { "target-features"="+dynamic-vgpr" } | ||
|
|
||
| ; Function with 79 VGPRs, which is 3 blocks with a block size of 32. | ||
| ; | ||
| ; DVGPR-LABEL: func79: | ||
| ; DVGPR: .set _dvgpr$func79, func79+16 | ||
| ; | ||
| define amdgpu_cs_chain void @func79(<79 x float> %arg) #1 { | ||
| ret void | ||
| } | ||
|
|
||
| ; Function with 225 VGPRs, which is 8 blocks with a block size of 32. | ||
| ; | ||
| ; DVGPR-LABEL: func225: | ||
| ; DVGPR: .set _dvgpr$func225, func225+56 | ||
| ; | ||
| define amdgpu_cs_chain void @func225(<225 x float> %arg) #1 { | ||
| ret void | ||
| } | ||
|
|
||
| attributes #0 = { "amdgpu-dynamic-vgpr-block-size"="16" } | ||
| attributes #1 = { "amdgpu-dynamic-vgpr-block-size"="32" } |
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.