-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[GISel][AArch64][AMDGPU][RISCV] Canonicalize (sub X, C) -> (add X, -C) #114309
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
7 commits
Select commit
Hold shift + click to select a range
13c2599
[GISel][AArch64][AMDGPU][RISCV] Canonicalize (sub X, C) -> (add X, -C)
topperc fa7ec2b
fixup! address review comments.
topperc 78d79f0
fixup! Add nuw/nsw flag tests.
topperc 1e3a249
fixup! Add isLegalOrBeforeLegalizer check
topperc 27433ab
fixup! Add isConstantLegalOrBeforeLegalizer.
topperc 49fec4a
Merge remote-tracking branch 'origin/main' into pr/gisel-add-to-sub
topperc 7efa9a4
Merge remote-tracking branch 'origin/main' into pr/gisel-add-to-sub
topperc 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1669,7 +1669,7 @@ define i65 @v_ashr_i65(i65 %value, i65 %amount) { | |
; GFX6-NEXT: v_sub_i32_e32 v8, vcc, 64, v3 | ||
; GFX6-NEXT: v_lshr_b64 v[6:7], v[0:1], v3 | ||
; GFX6-NEXT: v_lshl_b64 v[8:9], v[4:5], v8 | ||
; GFX6-NEXT: v_subrev_i32_e32 v2, vcc, 64, v3 | ||
; GFX6-NEXT: v_add_i32_e32 v2, vcc, 0xffffffc0, v3 | ||
; GFX6-NEXT: v_ashr_i64 v[10:11], v[4:5], v3 | ||
; GFX6-NEXT: v_or_b32_e32 v6, v6, v8 | ||
; GFX6-NEXT: v_ashrrev_i32_e32 v8, 31, v5 | ||
|
@@ -1692,7 +1692,7 @@ define i65 @v_ashr_i65(i65 %value, i65 %amount) { | |
; GFX8-NEXT: v_sub_u32_e32 v8, vcc, 64, v3 | ||
; GFX8-NEXT: v_lshrrev_b64 v[6:7], v3, v[0:1] | ||
; GFX8-NEXT: v_lshlrev_b64 v[8:9], v8, v[4:5] | ||
; GFX8-NEXT: v_subrev_u32_e32 v2, vcc, 64, v3 | ||
; GFX8-NEXT: v_add_u32_e32 v2, vcc, 0xffffffc0, v3 | ||
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 is worse. We already have the patterns to undo this, but I guess they didn't import. |
||
; GFX8-NEXT: v_ashrrev_i64 v[10:11], v3, v[4:5] | ||
; GFX8-NEXT: v_or_b32_e32 v6, v6, v8 | ||
; GFX8-NEXT: v_ashrrev_i32_e32 v8, 31, v5 | ||
|
@@ -1715,7 +1715,7 @@ define i65 @v_ashr_i65(i65 %value, i65 %amount) { | |
; GFX9-NEXT: v_sub_u32_e32 v8, 64, v3 | ||
; GFX9-NEXT: v_lshrrev_b64 v[6:7], v3, v[0:1] | ||
; GFX9-NEXT: v_lshlrev_b64 v[8:9], v8, v[4:5] | ||
; GFX9-NEXT: v_subrev_u32_e32 v2, 64, v3 | ||
; GFX9-NEXT: v_add_u32_e32 v2, 0xffffffc0, v3 | ||
; GFX9-NEXT: v_ashrrev_i64 v[10:11], v3, v[4:5] | ||
; GFX9-NEXT: v_or_b32_e32 v6, v6, v8 | ||
; GFX9-NEXT: v_ashrrev_i32_e32 v8, 31, v5 | ||
|
@@ -1735,7 +1735,7 @@ define i65 @v_ashr_i65(i65 %value, i65 %amount) { | |
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
; GFX10-NEXT: v_bfe_i32 v4, v2, 0, 1 | ||
; GFX10-NEXT: v_sub_nc_u32_e32 v2, 64, v3 | ||
; GFX10-NEXT: v_subrev_nc_u32_e32 v10, 64, v3 | ||
; GFX10-NEXT: v_add_nc_u32_e32 v10, 0xffffffc0, v3 | ||
; GFX10-NEXT: v_lshrrev_b64 v[6:7], v3, v[0:1] | ||
; GFX10-NEXT: v_cmp_gt_u32_e32 vcc_lo, 64, v3 | ||
; GFX10-NEXT: v_ashrrev_i32_e32 v5, 31, v4 | ||
|
@@ -1758,7 +1758,7 @@ define i65 @v_ashr_i65(i65 %value, i65 %amount) { | |
; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
; GFX11-NEXT: v_bfe_i32 v4, v2, 0, 1 | ||
; GFX11-NEXT: v_sub_nc_u32_e32 v2, 64, v3 | ||
; GFX11-NEXT: v_subrev_nc_u32_e32 v10, 64, v3 | ||
; GFX11-NEXT: v_add_nc_u32_e32 v10, 0xffffffc0, v3 | ||
; GFX11-NEXT: v_lshrrev_b64 v[6:7], v3, v[0:1] | ||
; GFX11-NEXT: v_cmp_gt_u32_e32 vcc_lo, 64, v3 | ||
; GFX11-NEXT: v_ashrrev_i32_e32 v5, 31, v4 | ||
|
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
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.