[llvm] [InstCombine] When canonicalizing clamp like, also consider certain sgt/slt cases (PR #153240)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 19 08:18:31 PDT 2025


================
@@ -1575,26 +1582,43 @@ static Value *canonicalizeClampLike(SelectInst &Sel0, ICmpInst &Cmp0,
                         m_CombineAnd(m_AnyIntegralConstant(), m_Constant(C1)))))
     return nullptr;
 
+  // Will create Replacement[Low/High] later for SExtICmp case
----------------
nikic wrote:

Can't we initialize them to 0/-1 right away to avoid the extra SwapReplacement logic?

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


More information about the llvm-commits mailing list