[llvm] [InstCombine] Canonicalize more saturated add variants (PR #100008)

Rose Silicon via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 28 12:07:43 PDT 2024


================
@@ -996,6 +989,30 @@ static Value *canonicalizeSaturatedAdd(ICmpInst *Cmp, Value *TVal, Value *FVal,
   if (!match(TVal, m_AllOnes()))
     return nullptr;
 
+  if ((Pred == ICmpInst::ICMP_UGE || Pred == ICmpInst::ICMP_UGT) &&
+      match(FVal, m_Add(m_Specific(Cmp0), m_APInt(C))) &&
+      match(Cmp1, m_SpecificIntAllowPoison(~*C))) {
----------------
RSilicon wrote:

Perhaps this doesn't do anything for poison since it already folded to poison. Are poison in splat vectors just vectors of nothing but poison?

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


More information about the llvm-commits mailing list