[Mlir-commits] [mlir] [mlir][tosa] Preserve all-NaN max-pool windows (PR #225744)

Jack Frankland llvmlistbot at llvm.org
Wed Sep 30 08:52:35 PDT 2026


================
@@ -742,16 +742,21 @@ class MaxPool2dConverter : public OpConversionPattern<tosa::MaxPool2dOp> {
     if (!resultTy)
       return rewriter.notifyMatchFailure(op, "failed to convert type");
     Type resultETy = inputTy.getElementType();
+    NanPropagationMode nanMode = op.getNanMode();
 
     SmallVector<Value> dynamicDims =
         computeDynamicOutputSizes(op, adaptor, rewriter);
 
     // Determine what the initial value needs to be for the max pool op.
     TypedAttr initialAttr;
-    if (resultETy.isF32() || resultETy.isBF16() || resultETy.isF16())
+    if (resultETy.isF32() || resultETy.isBF16() || resultETy.isF16()) {
----------------
FranklandJack wrote:

Ah good points. Guarded the `initialAttr` as you suggested and added tests for those types.

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


More information about the Mlir-commits mailing list