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

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 13:06:25 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Rose Silicon (RSilicon)

<details>
<summary>Changes</summary>

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
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,

``````````

</details>


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


More information about the llvm-commits mailing list