-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[AMDGPU] add tests for loop definition of bitconvert #133052
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
15 commits
Select commit
Hold shift + click to select a range
e01a648
add tests for loop definition of bitconvert
Shoreshen f022859
fix lit
Shoreshen 456a538
Merge branch 'main' into add-loop-bitconvert-tests
Shoreshen dd745c7
remove old test
Shoreshen a084707
Merge branch 'main' into add-loop-bitconvert-tests
Shoreshen ebc0849
replace bitconvert tests
Shoreshen 0640980
Merge branch 'main' into add-loop-bitconvert-tests
Shoreshen 5f31ec2
Merge remote-tracking branch 'origin/main' into add-loop-bitconvert-t…
Shoreshen d230120
remove options
Shoreshen d815a1c
Merge branch 'main' into add-loop-bitconvert-tests
Shoreshen 7e82093
Merge branch 'main' into add-loop-bitconvert-tests
Shoreshen 9ee605b
Merge branch 'main' into add-loop-bitconvert-tests
Shoreshen c3af25b
Merge branch 'main' into add-loop-bitconvert-tests
Shoreshen 3ec833e
Merge branch 'main' into add-loop-bitconvert-tests
Shoreshen 147e698
Merge branch 'main' into add-loop-bitconvert-tests
Shoreshen 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
2,394 changes: 2,394 additions & 0 deletions
2,394
llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
Large diffs are not rendered by default.
Oops, something went wrong.
6,084 changes: 6,084 additions & 0 deletions
6,084
llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.128bit.ll
Large diffs are not rendered by default.
Oops, something went wrong.
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,178 @@ | ||
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
|
|
||
| ; RUN: llc -mtriple=amdgcn -amdgpu-codegenprepare-break-large-phis-threshold=4096 < %s | FileCheck -check-prefix=GCN %s | ||
| ; RUN: llc -mtriple=amdgcn -mcpu=tonga -amdgpu-codegenprepare-break-large-phis-threshold=4096 < %s | FileCheck -check-prefixes=VI %s | ||
| ; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -amdgpu-codegenprepare-break-large-phis-threshold=4096 < %s | FileCheck -check-prefixes=GFX9 %s | ||
| ; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -amdgpu-codegenprepare-break-large-phis-threshold=4096 < %s | FileCheck -check-prefixes=GFX11 %s | ||
|
|
||
| define <5 x float> @v_bitcast_v5i32_to_v5f32(<5 x i32> %a, i32 %b) { | ||
|
||
| ; GCN-LABEL: v_bitcast_v5i32_to_v5f32: | ||
| ; GCN: ; %bb.0: | ||
| ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
| ; GCN-NEXT: v_cmp_ne_u32_e32 vcc, 0, v5 | ||
| ; GCN-NEXT: s_and_saveexec_b64 s[4:5], vcc | ||
| ; GCN-NEXT: s_xor_b64 s[4:5], exec, s[4:5] | ||
| ; GCN-NEXT: s_andn2_saveexec_b64 s[4:5], s[4:5] | ||
| ; GCN-NEXT: s_cbranch_execz .LBB0_2 | ||
| ; GCN-NEXT: ; %bb.1: ; %cmp.true | ||
| ; GCN-NEXT: v_add_i32_e32 v4, vcc, 3, v4 | ||
| ; GCN-NEXT: v_add_i32_e32 v3, vcc, 3, v3 | ||
| ; GCN-NEXT: v_add_i32_e32 v2, vcc, 3, v2 | ||
| ; GCN-NEXT: v_add_i32_e32 v1, vcc, 3, v1 | ||
| ; GCN-NEXT: v_add_i32_e32 v0, vcc, 3, v0 | ||
| ; GCN-NEXT: .LBB0_2: ; %end | ||
| ; GCN-NEXT: s_or_b64 exec, exec, s[4:5] | ||
| ; GCN-NEXT: s_setpc_b64 s[30:31] | ||
| ; | ||
| ; VI-LABEL: v_bitcast_v5i32_to_v5f32: | ||
| ; VI: ; %bb.0: | ||
| ; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
| ; VI-NEXT: v_cmp_ne_u32_e32 vcc, 0, v5 | ||
| ; VI-NEXT: s_and_saveexec_b64 s[4:5], vcc | ||
| ; VI-NEXT: s_xor_b64 s[4:5], exec, s[4:5] | ||
| ; VI-NEXT: s_andn2_saveexec_b64 s[4:5], s[4:5] | ||
| ; VI-NEXT: ; %bb.1: ; %cmp.true | ||
| ; VI-NEXT: v_add_u32_e32 v4, vcc, 3, v4 | ||
| ; VI-NEXT: v_add_u32_e32 v3, vcc, 3, v3 | ||
| ; VI-NEXT: v_add_u32_e32 v2, vcc, 3, v2 | ||
| ; VI-NEXT: v_add_u32_e32 v1, vcc, 3, v1 | ||
| ; VI-NEXT: v_add_u32_e32 v0, vcc, 3, v0 | ||
| ; VI-NEXT: ; %bb.2: ; %end | ||
| ; VI-NEXT: s_or_b64 exec, exec, s[4:5] | ||
| ; VI-NEXT: s_setpc_b64 s[30:31] | ||
| ; | ||
| ; GFX9-LABEL: v_bitcast_v5i32_to_v5f32: | ||
| ; GFX9: ; %bb.0: | ||
| ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
| ; GFX9-NEXT: v_cmp_ne_u32_e32 vcc, 0, v5 | ||
| ; GFX9-NEXT: s_and_saveexec_b64 s[4:5], vcc | ||
| ; GFX9-NEXT: s_xor_b64 s[4:5], exec, s[4:5] | ||
| ; GFX9-NEXT: s_andn2_saveexec_b64 s[4:5], s[4:5] | ||
| ; GFX9-NEXT: ; %bb.1: ; %cmp.true | ||
| ; GFX9-NEXT: v_add_u32_e32 v4, 3, v4 | ||
| ; GFX9-NEXT: v_add_u32_e32 v3, 3, v3 | ||
| ; GFX9-NEXT: v_add_u32_e32 v2, 3, v2 | ||
| ; GFX9-NEXT: v_add_u32_e32 v1, 3, v1 | ||
| ; GFX9-NEXT: v_add_u32_e32 v0, 3, v0 | ||
| ; GFX9-NEXT: ; %bb.2: ; %end | ||
| ; GFX9-NEXT: s_or_b64 exec, exec, s[4:5] | ||
| ; GFX9-NEXT: s_setpc_b64 s[30:31] | ||
| ; | ||
| ; GFX11-LABEL: v_bitcast_v5i32_to_v5f32: | ||
| ; GFX11: ; %bb.0: | ||
| ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
| ; GFX11-NEXT: s_mov_b32 s0, exec_lo | ||
| ; GFX11-NEXT: v_cmpx_ne_u32_e32 0, v5 | ||
| ; GFX11-NEXT: s_xor_b32 s0, exec_lo, s0 | ||
| ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | ||
| ; GFX11-NEXT: s_and_not1_saveexec_b32 s0, s0 | ||
| ; GFX11-NEXT: ; %bb.1: ; %cmp.true | ||
| ; GFX11-NEXT: v_add_nc_u32_e32 v4, 3, v4 | ||
| ; GFX11-NEXT: v_add_nc_u32_e32 v3, 3, v3 | ||
| ; GFX11-NEXT: v_add_nc_u32_e32 v2, 3, v2 | ||
| ; GFX11-NEXT: v_add_nc_u32_e32 v1, 3, v1 | ||
| ; GFX11-NEXT: v_add_nc_u32_e32 v0, 3, v0 | ||
| ; GFX11-NEXT: ; %bb.2: ; %end | ||
| ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s0 | ||
| ; GFX11-NEXT: s_setpc_b64 s[30:31] | ||
| %cmp = icmp eq i32 %b, 0 | ||
| br i1 %cmp, label %cmp.true, label %cmp.false | ||
|
|
||
| cmp.true: | ||
| %a1 = add <5 x i32> %a, splat (i32 3) | ||
| %a2 = bitcast <5 x i32> %a1 to <5 x float> | ||
| br label %end | ||
|
|
||
| cmp.false: | ||
| %a3 = bitcast <5 x i32> %a to <5 x float> | ||
| br label %end | ||
|
|
||
| end: | ||
| %phi = phi <5 x float> [ %a2, %cmp.true ], [ %a3, %cmp.false ] | ||
| ret <5 x float> %phi | ||
| } | ||
|
|
||
| define <5 x i32> @v_bitcast_v5f32_to_v5i32(<5 x float> %a, i32 %b) { | ||
| ; GCN-LABEL: v_bitcast_v5f32_to_v5i32: | ||
| ; GCN: ; %bb.0: | ||
| ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
| ; GCN-NEXT: v_cmp_ne_u32_e32 vcc, 0, v5 | ||
| ; GCN-NEXT: s_and_saveexec_b64 s[4:5], vcc | ||
| ; GCN-NEXT: s_xor_b64 s[4:5], exec, s[4:5] | ||
| ; GCN-NEXT: s_andn2_saveexec_b64 s[4:5], s[4:5] | ||
| ; GCN-NEXT: s_cbranch_execz .LBB1_2 | ||
| ; GCN-NEXT: ; %bb.1: ; %cmp.true | ||
| ; GCN-NEXT: v_add_f32_e32 v4, 1.0, v4 | ||
| ; GCN-NEXT: v_add_f32_e32 v3, 1.0, v3 | ||
| ; GCN-NEXT: v_add_f32_e32 v2, 1.0, v2 | ||
| ; GCN-NEXT: v_add_f32_e32 v1, 1.0, v1 | ||
| ; GCN-NEXT: v_add_f32_e32 v0, 1.0, v0 | ||
| ; GCN-NEXT: .LBB1_2: ; %end | ||
| ; GCN-NEXT: s_or_b64 exec, exec, s[4:5] | ||
| ; GCN-NEXT: s_setpc_b64 s[30:31] | ||
| ; | ||
| ; VI-LABEL: v_bitcast_v5f32_to_v5i32: | ||
| ; VI: ; %bb.0: | ||
| ; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
| ; VI-NEXT: v_cmp_ne_u32_e32 vcc, 0, v5 | ||
| ; VI-NEXT: s_and_saveexec_b64 s[4:5], vcc | ||
| ; VI-NEXT: s_xor_b64 s[4:5], exec, s[4:5] | ||
| ; VI-NEXT: s_andn2_saveexec_b64 s[4:5], s[4:5] | ||
| ; VI-NEXT: ; %bb.1: ; %cmp.true | ||
| ; VI-NEXT: v_add_f32_e32 v4, 1.0, v4 | ||
| ; VI-NEXT: v_add_f32_e32 v3, 1.0, v3 | ||
| ; VI-NEXT: v_add_f32_e32 v2, 1.0, v2 | ||
| ; VI-NEXT: v_add_f32_e32 v1, 1.0, v1 | ||
| ; VI-NEXT: v_add_f32_e32 v0, 1.0, v0 | ||
| ; VI-NEXT: ; %bb.2: ; %end | ||
| ; VI-NEXT: s_or_b64 exec, exec, s[4:5] | ||
| ; VI-NEXT: s_setpc_b64 s[30:31] | ||
| ; | ||
| ; GFX9-LABEL: v_bitcast_v5f32_to_v5i32: | ||
| ; GFX9: ; %bb.0: | ||
| ; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
| ; GFX9-NEXT: v_cmp_ne_u32_e32 vcc, 0, v5 | ||
| ; GFX9-NEXT: s_and_saveexec_b64 s[4:5], vcc | ||
| ; GFX9-NEXT: s_xor_b64 s[4:5], exec, s[4:5] | ||
| ; GFX9-NEXT: s_andn2_saveexec_b64 s[4:5], s[4:5] | ||
| ; GFX9-NEXT: ; %bb.1: ; %cmp.true | ||
| ; GFX9-NEXT: v_add_f32_e32 v4, 1.0, v4 | ||
| ; GFX9-NEXT: v_add_f32_e32 v3, 1.0, v3 | ||
| ; GFX9-NEXT: v_add_f32_e32 v2, 1.0, v2 | ||
| ; GFX9-NEXT: v_add_f32_e32 v1, 1.0, v1 | ||
| ; GFX9-NEXT: v_add_f32_e32 v0, 1.0, v0 | ||
| ; GFX9-NEXT: ; %bb.2: ; %end | ||
| ; GFX9-NEXT: s_or_b64 exec, exec, s[4:5] | ||
| ; GFX9-NEXT: s_setpc_b64 s[30:31] | ||
| ; | ||
| ; GFX11-LABEL: v_bitcast_v5f32_to_v5i32: | ||
| ; GFX11: ; %bb.0: | ||
| ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
| ; GFX11-NEXT: s_mov_b32 s0, exec_lo | ||
| ; GFX11-NEXT: v_cmpx_ne_u32_e32 0, v5 | ||
| ; GFX11-NEXT: s_xor_b32 s0, exec_lo, s0 | ||
| ; GFX11-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | ||
| ; GFX11-NEXT: s_and_not1_saveexec_b32 s0, s0 | ||
| ; GFX11-NEXT: ; %bb.1: ; %cmp.true | ||
| ; GFX11-NEXT: v_dual_add_f32 v4, 1.0, v4 :: v_dual_add_f32 v3, 1.0, v3 | ||
| ; GFX11-NEXT: v_dual_add_f32 v2, 1.0, v2 :: v_dual_add_f32 v1, 1.0, v1 | ||
| ; GFX11-NEXT: v_add_f32_e32 v0, 1.0, v0 | ||
| ; GFX11-NEXT: ; %bb.2: ; %end | ||
| ; GFX11-NEXT: s_or_b32 exec_lo, exec_lo, s0 | ||
| ; GFX11-NEXT: s_setpc_b64 s[30:31] | ||
| %cmp = icmp eq i32 %b, 0 | ||
| br i1 %cmp, label %cmp.true, label %cmp.false | ||
|
|
||
| cmp.true: | ||
| %a1 = fadd <5 x float> %a, splat (float 1.000000e+00) | ||
| %a2 = bitcast <5 x float> %a1 to <5 x i32> | ||
| br label %end | ||
|
|
||
| cmp.false: | ||
| %a3 = bitcast <5 x float> %a to <5 x i32> | ||
| br label %end | ||
|
|
||
| end: | ||
| %phi = phi <5 x i32> [ %a2, %cmp.true ], [ %a3, %cmp.false ] | ||
| ret <5 x i32> %phi | ||
| } | ||
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.