- Notifications
You must be signed in to change notification settings - Fork 15.3k
[SDAG] Drop select -> fmax/min folding in SelectionDAGBuilder #93575
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
Open
dtcxzyw wants to merge 4 commits into llvm:main Choose a base branch from dtcxzyw:fix-93414
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Open
Changes from all 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
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 |
|---|---|---|
| | @@ -1016,7 +1016,10 @@ define amdgpu_kernel void @v_test_legacy_fmed3_r_i_i_f32(ptr addrspace(1) %out, | |
| ; VI-SDAG-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc | ||
| ; VI-SDAG-NEXT: s_waitcnt vmcnt(0) | ||
| ; VI-SDAG-NEXT: v_add_f32_e32 v2, 1.0, v3 | ||
| ; VI-SDAG-NEXT: v_med3_f32 v2, v2, 2.0, 4.0 | ||
| ; VI-SDAG-NEXT: v_cmp_lt_f32_e32 vcc, 2.0, v2 | ||
| ; VI-SDAG-NEXT: v_cndmask_b32_e32 v2, 2.0, v2, vcc | ||
| ; VI-SDAG-NEXT: v_cmp_gt_f32_e32 vcc, 4.0, v2 | ||
| ; VI-SDAG-NEXT: v_cndmask_b32_e32 v2, 4.0, v2, vcc | ||
| ; VI-SDAG-NEXT: flat_store_dword v[0:1], v2 | ||
| ; VI-SDAG-NEXT: s_endpgm | ||
| ; | ||
| | @@ -1051,7 +1054,10 @@ define amdgpu_kernel void @v_test_legacy_fmed3_r_i_i_f32(ptr addrspace(1) %out, | |
| ; GFX9-SDAG-NEXT: global_load_dword v1, v0, s[2:3] | ||
| ; GFX9-SDAG-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX9-SDAG-NEXT: v_add_f32_e32 v1, 1.0, v1 | ||
| ; GFX9-SDAG-NEXT: v_med3_f32 v1, v1, 2.0, 4.0 | ||
| ; GFX9-SDAG-NEXT: v_cmp_lt_f32_e32 vcc, 2.0, v1 | ||
| ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, 2.0, v1, vcc | ||
| Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This regression actually doesn't look good. I need to look at this, but running instcombine on the test first doesn't recover the v_med3_f32 | ||
| ; GFX9-SDAG-NEXT: v_cmp_gt_f32_e32 vcc, 4.0, v1 | ||
| ; GFX9-SDAG-NEXT: v_cndmask_b32_e32 v1, 4.0, v1, vcc | ||
| ; GFX9-SDAG-NEXT: global_store_dword v0, v1, s[0:1] | ||
| ; GFX9-SDAG-NEXT: s_endpgm | ||
| ; | ||
| | @@ -1078,8 +1084,11 @@ define amdgpu_kernel void @v_test_legacy_fmed3_r_i_i_f32(ptr addrspace(1) %out, | |
| ; GFX11-SDAG-NEXT: global_load_b32 v1, v0, s[2:3] | ||
| ; GFX11-SDAG-NEXT: s_waitcnt vmcnt(0) | ||
| ; GFX11-SDAG-NEXT: v_add_f32_e32 v1, 1.0, v1 | ||
| ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | ||
| ; GFX11-SDAG-NEXT: v_med3_f32 v1, v1, 2.0, 4.0 | ||
| ; GFX11-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1) | ||
| ; GFX11-SDAG-NEXT: v_cmp_lt_f32_e32 vcc_lo, 2.0, v1 | ||
| ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 2.0, v1, vcc_lo | ||
| ; GFX11-SDAG-NEXT: v_cmp_gt_f32_e32 vcc_lo, 4.0, v1 | ||
| ; GFX11-SDAG-NEXT: v_cndmask_b32_e32 v1, 4.0, v1, vcc_lo | ||
| ; GFX11-SDAG-NEXT: global_store_b32 v0, v1, s[0:1] | ||
| ; GFX11-SDAG-NEXT: s_nop 0 | ||
| ; GFX11-SDAG-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS) | ||
| | ||
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.
I just noticed we don't actually have the DAG combine to form nnan select -> minimum/maximum. Ideally we would implement that before dropping this
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.
Are you working on this?
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.
Not yet, I was considering it
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.
Are you going to work on this? If not I can probably pick this up
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.
No.