-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[AMDGPU] Implement moveToVALU for S_CSELECT_B64 #70352
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
Changes from all commits
Commits
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3 | ||
; RUN: llc -march=amdgcn -mcpu=gfx1030 < %s | FileCheck %s | ||
|
||
define amdgpu_cs <2 x i32> @f() { | ||
; CHECK-LABEL: f: | ||
; CHECK: ; %bb.0: ; %bb | ||
; CHECK-NEXT: s_mov_b32 s0, 0 | ||
; CHECK-NEXT: s_mov_b32 s1, s0 | ||
; CHECK-NEXT: s_mov_b32 s2, s0 | ||
; CHECK-NEXT: s_mov_b32 s3, s0 | ||
; CHECK-NEXT: s_mov_b32 s4, s0 | ||
; CHECK-NEXT: buffer_load_dwordx2 v[0:1], off, s[0:3], 0 | ||
; CHECK-NEXT: s_mov_b32 s5, s0 | ||
; CHECK-NEXT: v_mov_b32_e32 v2, s0 | ||
; CHECK-NEXT: s_waitcnt vmcnt(0) | ||
; CHECK-NEXT: v_cmp_ne_u64_e32 vcc_lo, s[4:5], v[0:1] | ||
; CHECK-NEXT: v_mov_b32_e32 v0, 0 | ||
; CHECK-NEXT: v_cndmask_b32_e64 v1, 0, 1, vcc_lo | ||
; CHECK-NEXT: buffer_store_dwordx2 v[1:2], off, s[0:3], 0 | ||
; CHECK-NEXT: ; return to shader part epilog | ||
bb: | ||
%i = call <2 x i32> @llvm.amdgcn.raw.buffer.load.v2i32(<4 x i32> zeroinitializer, i32 0, i32 0, i32 0) | ||
%i1 = bitcast <2 x i32> %i to i64 | ||
%i2 = insertelement <3 x i64> zeroinitializer, i64 %i1, i64 2 | ||
%i3 = icmp ne <3 x i64> %i2, zeroinitializer | ||
%i4 = zext <3 x i1> %i3 to <3 x i64> | ||
%i5 = bitcast <3 x i64> %i4 to <6 x i32> | ||
%i6 = shufflevector <6 x i32> %i5, <6 x i32> zeroinitializer, <2 x i32> <i32 4, i32 5> | ||
call void @llvm.amdgcn.raw.buffer.store.v2i32(<2 x i32> %i6, <4 x i32> zeroinitializer, i32 0, i32 0, i32 0) | ||
ret <2 x i32> %i6 | ||
} | ||
|
||
declare <2 x i32> @llvm.amdgcn.raw.buffer.load.v2i32(<4 x i32>, i32, i32, i32 immarg) | ||
declare void @llvm.amdgcn.raw.buffer.store.v2i32(<2 x i32>, <4 x i32>, i32, i32, i32 immarg) |
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
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.
Wow! I didn't know it does exist. Seems useful.
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.
This is mostly copied from the handling of
S_ADD_U64_PSEUDO
and other 64-bit pseudos that get split.