[Mlir-commits] [mlir] [mlir][arith] Fix arith maxnumf/minnumf folder (PR #114595)

Jakub Kuderski llvmlistbot at llvm.org
Mon Nov 4 08:03:54 PST 2024


================
@@ -1014,13 +1014,14 @@ OpFoldResult arith::MaxNumFOp::fold(FoldAdaptor adaptor) {
   if (getLhs() == getRhs())
     return getRhs();
 
-  // maxnumf(x, -inf) -> x
-  if (matchPattern(adaptor.getRhs(), m_NegInfFloat()))
+  // maxnumf(x, NaN) -> x
+  if (matchPattern(adaptor.getRhs(), m_NaNFloat()))
     return getLhs();
----------------
kuhar wrote:

Shouldn't this be maintained but updated to check that x is not NaN?

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


More information about the Mlir-commits mailing list