[llvm] [InstSimplify] Fold {u, s}{min, max} x, poison -> poison (PR #138166)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu May 1 09:59:36 PDT 2025


================
@@ -6549,6 +6549,10 @@ Value *llvm::simplifyBinaryIntrinsic(Intrinsic::ID IID, Type *ReturnType,
     if (match(Op0, m_ImmConstant()))
       std::swap(Op0, Op1);
 
+    // Propagate poison.
+    if (isa<PoisonValue>(Op1))
----------------
lukel97 wrote:

Ah thanks for showing this, that explains why two poison operands get folded. 

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


More information about the llvm-commits mailing list