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

Rose Silicon via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 13:05:48 PDT 2024


https://github.com/RSilicon created https://github.com/llvm/llvm-project/pull/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.

>From c9d6c85c45c63b5dc15364cb27da7b0b92f336fe Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Mon, 29 Jul 2024 16:05:15 -0400
Subject: [PATCH] [InstCombine] (NFC) Remove TODO for a - UMIN

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.
---
 llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp | 1 -
 1 file changed, 1 deletion(-)

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,



More information about the llvm-commits mailing list