-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[DAG] Fold (umin (sub a b) a) -> (usubo a b); (select usubo.1 a usubo.0) #161651
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 7 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
3a24f85
[DAG] Fold (umin (sub a b) a) -> (usubo a b); (select usubo.1 a usubo.0)
ckoparkar 0db4bf0
Remove smin pattern, it might not be correct
ckoparkar 1848dd5
Merge branch 'main' into ckoparkar/161036
ckoparkar c0ba3fd
Fix check for retq
ckoparkar 5aa0f85
Merge branch 'main' into ckoparkar/161036
ckoparkar 57e2ea0
Address review comments
ckoparkar 7e08f23
Don't use MVT::i1
ckoparkar 7660fae
Fix pattern match
ckoparkar d795383
Add some more tests
ckoparkar a27dcf5
Simplify pattern match
ckoparkar 9b6df39
Merge branch 'main' into ckoparkar/161036
ckoparkar cd06ef4
Merge branch 'main' into ckoparkar/161036
ckoparkar 83f8ad0
Merge branch 'main' into ckoparkar/161036
ckoparkar e1ba30b
Edits
ckoparkar 224f0a3
Merge branch 'main' into ckoparkar/161036
ckoparkar 6df10cc
Adjust patterns for AMDGPU
ckoparkar 0a54b44
Adjust patterns in AMDGPU/llvm.set.rounding.ll
ckoparkar b3579ab
Apply arsenm's suggestion
ckoparkar 4610bf5
Merge branch 'main' into ckoparkar/161036
ckoparkar 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
Some comments aren't visible on the classic Files Changed page.
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,14 @@ | ||
| ; RUN: llc < %s -mtriple=aarch64 | FileCheck %s | ||
|
|
||
| ; GitHub issue #161036 | ||
|
|
||
| define i64 @underflow_compare_fold(i64 %a, i64 %b) { | ||
ckoparkar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ; CHECK-LABEL: underflow_compare_fold | ||
| ; CHECK: // %bb.0: | ||
| ; CHECK-NEXT: subs x8, x0, x1 | ||
| ; CHECK-NEXT: csel x0, x0, x8, lo | ||
| ; CHECK-NEXT: ret | ||
| %sub = sub i64 %a, %b | ||
| %cond = tail call i64 @llvm.umin.i64(i64 %sub, i64 %a) | ||
| ret i64 %cond | ||
| } | ||
ckoparkar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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,15 @@ | ||
| ; RUN: llc < %s -mtriple=x86_64 | FileCheck %s | ||
|
|
||
| ; GitHub issue #161036 | ||
|
|
||
| define i64 @underflow_compare_fold(i64 %a, i64 %b) { | ||
| ; CHECK-LABEL: underflow_compare_fold | ||
| ; CHECK-LABEL: %bb.0 | ||
| ; CHECK-NEXT: movq %rdi, %rax | ||
| ; CHECK-NEXT: subq %rsi, %rax | ||
| ; CHECK-NEXT: cmovbq %rdi, %rax | ||
| ; CHECK-NEXT: retq | ||
| %sub = sub i64 %a, %b | ||
| %cond = tail call i64 @llvm.umin.i64(i64 %sub, i64 %a) | ||
| ret i64 %cond | ||
| } |
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.