-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[AMDGPU][gfx1250] Add cu-store
subtarget feature
#150588
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
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,100 @@ | ||
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O3 -mcpu=gfx1250 < %s | FileCheck --check-prefixes=GCN,CU %s | ||
; RUN: llc -mtriple=amdgcn-amd-amdhsa -O3 -mcpu=gfx1250 -mattr=-cu-stores < %s | FileCheck --check-prefixes=GCN,NOCU %s | ||
|
||
; Check that if -cu-stores is used, we use SCOPE_SE minimum on all stores. | ||
|
||
; GCN: flat_store: | ||
; CU: flat_store_b32 v{{.*}}, v{{.*}}, s{{.*}} scope:SCOPE_SE | ||
; NOCU: flat_store_b32 v{{.*}}, v{{.*}}, s{{.*}} scope:SCOPE_SE | ||
; GCN: .amdhsa_kernel flat_store | ||
; CU: .amdhsa_uses_cu_stores 1 | ||
; NOCU: .amdhsa_uses_cu_stores 0 | ||
define amdgpu_kernel void @flat_store(ptr %dst, i32 %val) { | ||
entry: | ||
store i32 %val, ptr %dst | ||
ret void | ||
} | ||
|
||
; GCN: global_store: | ||
; CU: global_store_b32 v{{.*}}, v{{.*}}, s{{.*}}{{$}} | ||
; NOCU: global_store_b32 v{{.*}}, v{{.*}}, s{{.*}} scope:SCOPE_SE | ||
; GCN: .amdhsa_kernel global_store | ||
; CU: .amdhsa_uses_cu_stores 1 | ||
; NOCU: .amdhsa_uses_cu_stores 0 | ||
define amdgpu_kernel void @global_store(ptr addrspace(1) %dst, i32 %val) { | ||
entry: | ||
store i32 %val, ptr addrspace(1) %dst | ||
ret void | ||
} | ||
|
||
; GCN: local_store: | ||
; CU: ds_store_b32 v{{.*}}, v{{.*}}{{$}} | ||
; NOCU: ds_store_b32 v{{.*}}, v{{.*}}{{$}} | ||
; GCN: .amdhsa_kernel local_store | ||
; CU: .amdhsa_uses_cu_stores 1 | ||
; NOCU: .amdhsa_uses_cu_stores 0 | ||
define amdgpu_kernel void @local_store(ptr addrspace(3) %dst, i32 %val) { | ||
entry: | ||
store i32 %val, ptr addrspace(3) %dst | ||
ret void | ||
} | ||
|
||
; GCN: scratch_store: | ||
; CU: scratch_store_b32 off, v{{.*}}, s{{.*}} scope:SCOPE_SE | ||
; NOCU: scratch_store_b32 off, v{{.*}}, s{{.*}} scope:SCOPE_SE | ||
; GCN: .amdhsa_kernel scratch_store | ||
; CU: .amdhsa_uses_cu_stores 1 | ||
; NOCU: .amdhsa_uses_cu_stores 0 | ||
define amdgpu_kernel void @scratch_store(ptr addrspace(5) %dst, i32 %val) { | ||
entry: | ||
store i32 %val, ptr addrspace(5) %dst | ||
ret void | ||
} | ||
|
||
; GCN: flat_atomic_store: | ||
; CU: flat_store_b32 v{{.*}}, v{{.*}}, s{{.*}} scope:SCOPE_SE | ||
; NOCU: flat_store_b32 v{{.*}}, v{{.*}}, s{{.*}} scope:SCOPE_SE | ||
; GCN: .amdhsa_kernel flat_atomic_store | ||
; CU: .amdhsa_uses_cu_stores 1 | ||
; NOCU: .amdhsa_uses_cu_stores 0 | ||
define amdgpu_kernel void @flat_atomic_store(ptr %dst, i32 %val) { | ||
entry: | ||
store atomic i32 %val, ptr %dst syncscope("wavefront") unordered, align 4 | ||
ret void | ||
} | ||
|
||
; GCN: global_atomic_store: | ||
; CU: global_store_b32 v{{.*}}, v{{.*}}, s{{.*}}{{$}} | ||
; NOCU: global_store_b32 v{{.*}}, v{{.*}}, s{{.*}} scope:SCOPE_SE | ||
; GCN: .amdhsa_kernel global_atomic_store | ||
; CU: .amdhsa_uses_cu_stores 1 | ||
; NOCU: .amdhsa_uses_cu_stores 0 | ||
define amdgpu_kernel void @global_atomic_store(ptr addrspace(1) %dst, i32 %val) { | ||
entry: | ||
store atomic i32 %val, ptr addrspace(1) %dst syncscope("wavefront") unordered, align 4 | ||
ret void | ||
} | ||
|
||
; GCN: local_atomic_store: | ||
; CU: ds_store_b32 v{{.*}}, v{{.*}}{{$}} | ||
; NOCU: ds_store_b32 v{{.*}}, v{{.*}}{{$}} | ||
; GCN: .amdhsa_kernel local_atomic_store | ||
; CU: .amdhsa_uses_cu_stores 1 | ||
; NOCU: .amdhsa_uses_cu_stores 0 | ||
define amdgpu_kernel void @local_atomic_store(ptr addrspace(3) %dst, i32 %val) { | ||
entry: | ||
store atomic i32 %val, ptr addrspace(3) %dst syncscope("wavefront") unordered, align 4 | ||
ret void | ||
} | ||
|
||
; GCN: scratch_atomic_store: | ||
; CU: scratch_store_b32 off, v{{.*}}, s{{.*}} scope:SCOPE_SE | ||
; NOCU: scratch_store_b32 off, v{{.*}}, s{{.*}} scope:SCOPE_SE | ||
; GCN: .amdhsa_kernel scratch_atomic_store | ||
; CU: .amdhsa_uses_cu_stores 1 | ||
; NOCU: .amdhsa_uses_cu_stores 0 | ||
define amdgpu_kernel void @scratch_atomic_store(ptr addrspace(5) %dst, i32 %val) { | ||
entry: | ||
store atomic i32 %val, ptr addrspace(5) %dst syncscope("wavefront") unordered, align 4 | ||
ret void | ||
} |
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
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.
If this is supposed to be a software controlled setting, it probably should be a separate attribute
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.
I don't understand, only
.amdhsa_uses_cu_stores
needs to be in the metadata. The intention is that the runtime can check whether the code was built with+
or-cu-stores