Skip to content

[InstCombine] (NFC) Remove improper TODO for a - UMIN #101076

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 1 commit into from
Aug 6, 2024
Merged

Conversation

AZero13
Copy link
Contributor

@AZero13 AZero13 commented Jul 29, 2024

It is already handled in a different method, especially as a - UMIN(a, b) cannot be handled by a select statement, unless it means something like: "(c < b) ? b - ((b > c) ? c : b) : 0;" but LLVM handles that case as well.

It is already handled in a different method, especially as a - UMIN(a, b) cannot be handled by a select statement, unless it means something like: "(c < b) ? b - ((b > c) ? c : b) : 0;" but llvm handles that case as well.
@llvmbot
Copy link
Member

llvmbot commented Jul 29, 2024

@llvm/pr-subscribers-llvm-transforms

Author: Rose Silicon (RSilicon)

Changes

It is already handled in a different method, especially as a - UMIN(a, b) cannot be handled by a select statement, unless it means something like: "(c < b) ? b - ((b > c) ? c : b) : 0;" but llvm handles that case as well.


Full diff: https://github.com/llvm/llvm-project/pull/101076.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp (-1)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
index a22ee1de0ac21..e4cbac65bd663 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -899,7 +899,6 @@ static Instruction *foldSelectZeroOrMul(SelectInst &SI, InstCombinerImpl &IC) {
 
 /// Transform patterns such as (a > b) ? a - b : 0 into usub.sat(a, b).
 /// There are 8 commuted/swapped variants of this pattern.
-/// TODO: Also support a - UMIN(a,b) patterns.
 static Value *canonicalizeSaturatedSubtract(const ICmpInst *ICI,
                                             const Value *TrueVal,
                                             const Value *FalseVal,

@AZero13 AZero13 changed the title [InstCombine] (NFC) Remove TODO for a - UMIN [InstCombine] (NFC) Remove improper TODO for a - UMIN Jul 29, 2024
@AZero13 AZero13 marked this pull request as draft July 29, 2024 20:12
@AZero13 AZero13 marked this pull request as ready for review July 29, 2024 20:13
@goldsteinn
Copy link
Contributor

LGTM

@AZero13
Copy link
Contributor Author

AZero13 commented Aug 6, 2024

LGTM

Can we merge this please?

Copy link
Collaborator

@topperc topperc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@topperc topperc merged commit 278c0ad into llvm:main Aug 6, 2024
11 checks passed
@AZero13 AZero13 deleted the UMIN branch August 6, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants