-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[AMDGPU] Do not fold into v_accvpr_mov/write/read #120475
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 3 commits
Commits
Show all changes
4 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
| ; RUN: llc -O3 -mtriple=amdgcn--amdhsa -mcpu=gfx942 %s -o - | FileCheck %s --check-prefixes=GFX942 | ||
| ; RUN: llc -O3 -mtriple=amdgcn--amdhsa -mcpu=gfx908 %s -o - | FileCheck %s --check-prefixes=GFX908 | ||
|
|
||
| define amdgpu_kernel void @test(i1 %arg, i1 %arg1) { | ||
bcahoon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ; GFX942-LABEL: test: | ||
| ; GFX942: ; %bb.0: ; %bb | ||
| ; GFX942-NEXT: s_load_dword s0, s[4:5], 0x0 | ||
| ; GFX942-NEXT: v_mov_b32_e32 v1, 0 | ||
| ; GFX942-NEXT: s_mov_b32 s2, 0 | ||
| ; GFX942-NEXT: v_accvgpr_write_b32 a0, v1 | ||
| ; GFX942-NEXT: s_mov_b32 s3, 0 | ||
| ; GFX942-NEXT: s_waitcnt lgkmcnt(0) | ||
| ; GFX942-NEXT: s_bitcmp1_b32 s0, 0 | ||
| ; GFX942-NEXT: s_cselect_b64 s[0:1], -1, 0 | ||
| ; GFX942-NEXT: v_cndmask_b32_e64 v0, 0, 1, s[0:1] | ||
| ; GFX942-NEXT: v_cmp_ne_u32_e64 s[0:1], 1, v0 | ||
| ; GFX942-NEXT: s_branch .LBB0_2 | ||
| ; GFX942-NEXT: .LBB0_1: ; %Flow | ||
| ; GFX942-NEXT: ; in Loop: Header=BB0_2 Depth=1 | ||
| ; GFX942-NEXT: s_andn2_b64 vcc, exec, s[4:5] | ||
| ; GFX942-NEXT: s_cbranch_vccz .LBB0_4 | ||
| ; GFX942-NEXT: .LBB0_2: ; %bb2 | ||
| ; GFX942-NEXT: ; =>This Inner Loop Header: Depth=1 | ||
| ; GFX942-NEXT: s_and_b64 vcc, exec, s[0:1] | ||
| ; GFX942-NEXT: s_mov_b64 s[4:5], -1 | ||
| ; GFX942-NEXT: s_cbranch_vccnz .LBB0_1 | ||
| ; GFX942-NEXT: ; %bb.3: ; %bb4 | ||
| ; GFX942-NEXT: ; in Loop: Header=BB0_2 Depth=1 | ||
| ; GFX942-NEXT: s_or_b32 s4, s3, 1 | ||
| ; GFX942-NEXT: s_ashr_i32 s5, s3, 31 | ||
| ; GFX942-NEXT: s_mov_b32 s3, s2 | ||
| ; GFX942-NEXT: v_mov_b64_e32 v[4:5], s[2:3] | ||
| ; GFX942-NEXT: v_accvgpr_read_b32 v0, a0 | ||
| ; GFX942-NEXT: v_mov_b32_e32 v2, v1 | ||
| ; GFX942-NEXT: v_mov_b32_e32 v3, v1 | ||
| ; GFX942-NEXT: v_accvgpr_write_b32 a0, v0 | ||
| ; GFX942-NEXT: v_accvgpr_write_b32 a1, v1 | ||
| ; GFX942-NEXT: v_accvgpr_write_b32 a2, v2 | ||
| ; GFX942-NEXT: v_accvgpr_write_b32 a3, v3 | ||
| ; GFX942-NEXT: s_and_b32 s3, s5, s4 | ||
| ; GFX942-NEXT: s_mov_b64 s[4:5], 0 | ||
| ; GFX942-NEXT: v_mfma_f32_16x16x16_f16 a[0:3], v[4:5], v[4:5], a[0:3] | ||
| ; GFX942-NEXT: s_branch .LBB0_1 | ||
| ; GFX942-NEXT: .LBB0_4: ; %common.ret | ||
| ; GFX942-NEXT: s_endpgm | ||
| ; | ||
| ; GFX908-LABEL: test: | ||
| ; GFX908: ; %bb.0: ; %bb | ||
| ; GFX908-NEXT: s_load_dword s0, s[8:9], 0x0 | ||
| ; GFX908-NEXT: v_mov_b32_e32 v1, 0 | ||
| ; GFX908-NEXT: s_mov_b32 s2, 0 | ||
| ; GFX908-NEXT: s_mov_b32 s3, 0 | ||
| ; GFX908-NEXT: v_accvgpr_write_b32 a0, v1 | ||
| ; GFX908-NEXT: s_waitcnt lgkmcnt(0) | ||
| ; GFX908-NEXT: s_bitcmp1_b32 s0, 0 | ||
| ; GFX908-NEXT: s_cselect_b64 s[0:1], -1, 0 | ||
| ; GFX908-NEXT: v_cndmask_b32_e64 v0, 0, 1, s[0:1] | ||
| ; GFX908-NEXT: v_cmp_ne_u32_e64 s[0:1], 1, v0 | ||
| ; GFX908-NEXT: s_branch .LBB0_2 | ||
| ; GFX908-NEXT: .LBB0_1: ; %Flow | ||
| ; GFX908-NEXT: ; in Loop: Header=BB0_2 Depth=1 | ||
| ; GFX908-NEXT: s_andn2_b64 vcc, exec, s[4:5] | ||
| ; GFX908-NEXT: s_cbranch_vccz .LBB0_4 | ||
| ; GFX908-NEXT: .LBB0_2: ; %bb2 | ||
| ; GFX908-NEXT: ; =>This Inner Loop Header: Depth=1 | ||
| ; GFX908-NEXT: s_and_b64 vcc, exec, s[0:1] | ||
| ; GFX908-NEXT: s_mov_b64 s[4:5], -1 | ||
| ; GFX908-NEXT: s_cbranch_vccnz .LBB0_1 | ||
| ; GFX908-NEXT: ; %bb.3: ; %bb4 | ||
| ; GFX908-NEXT: ; in Loop: Header=BB0_2 Depth=1 | ||
| ; GFX908-NEXT: s_or_b32 s4, s3, 1 | ||
| ; GFX908-NEXT: s_ashr_i32 s5, s3, 31 | ||
| ; GFX908-NEXT: s_mov_b32 s3, s2 | ||
| ; GFX908-NEXT: v_accvgpr_read_b32 v0, a0 | ||
| ; GFX908-NEXT: v_mov_b32_e32 v5, s3 | ||
| ; GFX908-NEXT: v_mov_b32_e32 v4, s2 | ||
| ; GFX908-NEXT: v_mov_b32_e32 v2, v1 | ||
| ; GFX908-NEXT: v_mov_b32_e32 v3, v1 | ||
| ; GFX908-NEXT: v_accvgpr_write_b32 a0, v0 | ||
| ; GFX908-NEXT: v_accvgpr_write_b32 a1, v1 | ||
| ; GFX908-NEXT: v_accvgpr_write_b32 a2, v2 | ||
| ; GFX908-NEXT: v_accvgpr_write_b32 a3, v3 | ||
| ; GFX908-NEXT: s_and_b32 s3, s5, s4 | ||
| ; GFX908-NEXT: v_mfma_f32_16x16x16f16 a[0:3], v[4:5], v[4:5], a[0:3] | ||
| ; GFX908-NEXT: s_mov_b64 s[4:5], 0 | ||
| ; GFX908-NEXT: s_branch .LBB0_1 | ||
| ; GFX908-NEXT: .LBB0_4: ; %common.ret | ||
| ; GFX908-NEXT: s_endpgm | ||
| bb: | ||
| br label %bb2 | ||
|
|
||
| bb2: | ||
| %i = phi { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float } [ %i12, %bb4 ], [ zeroinitializer, %bb ] | ||
| %i3 = phi i32 [ %i7, %bb4 ], [ 0, %bb ] | ||
| br i1 %arg, label %bb4, label %bb13 | ||
|
|
||
| bb4: | ||
| %i5 = or i32 %i3, 1 | ||
| %i6 = icmp slt i32 %i3, 0 | ||
| %i7 = select i1 %i6, i32 %i5, i32 0 | ||
| %i8 = extractvalue { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float } %i, 123 | ||
| %i9 = insertelement <4 x float> zeroinitializer, float %i8, i32 0 | ||
| %i10 = call <4 x float> @llvm.amdgcn.mfma.f32.16x16x16f16(<4 x half> zeroinitializer, <4 x half> zeroinitializer, <4 x float> %i9, i32 0, i32 0, i32 0) | ||
| %i11 = extractelement <4 x float> %i10, i32 0 | ||
| %i12 = insertvalue { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float } zeroinitializer, float %i11, 123 | ||
| br label %bb2 | ||
|
|
||
| bb13: | ||
| br i1 %arg1, label %bb14, label %common.ret | ||
|
|
||
| common.ret: | ||
| ret void | ||
|
|
||
| bb14: | ||
| %i15 = extractvalue { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float } %i, 0 | ||
| %i16 = insertelement <4 x float> zeroinitializer, float %i15, i32 0 | ||
| br label %common.ret | ||
| } | ||
|
|
||
| ; Function Attrs: convergent nocallback nofree nosync nounwind willreturn memory(none) | ||
| declare <4 x float> @llvm.amdgcn.mfma.f32.16x16x16f16(<4 x half>, <4 x half>, <4 x float>, i32 immarg, i32 immarg, i32 immarg) #0 | ||
|
|
||
| attributes #0 = { convergent nocallback nofree nosync nounwind willreturn memory(none) } | ||
Oops, something went wrong.
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.