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

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 13:39:07 PDT 2024


Author: Rose Silicon
Date: 2024-08-06T13:39:03-07:00
New Revision: 278c0ad99ef59f227fee3675cdac5bb581e1d6bf

URL: https://github.com/llvm/llvm-project/commit/278c0ad99ef59f227fee3675cdac5bb581e1d6bf
DIFF: https://github.com/llvm/llvm-project/commit/278c0ad99ef59f227fee3675cdac5bb581e1d6bf.diff

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

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.

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
index 39c185ee194dd..6025e73f07cf3 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -897,7 +897,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,


        


More information about the llvm-commits mailing list