[Mlir-commits] [mlir] [mlir[tosa] Switch zero point of avgpool2d to input variable type (PR #128983)

Jack Frankland llvmlistbot at llvm.org
Thu Feb 27 06:42:12 PST 2025


================
@@ -804,6 +804,15 @@ class AvgPool2dConverter : public OpRewritePattern<tosa::AvgPool2dOp> {
       return failure();
     SmallVector<Value> dynamicDims = *dynamicDimsOr;
 
+    int64_t inputZpVal;
+    int64_t outputZpVal;
+    if (op.getInputZeroPoint(inputZpVal).failed() ||
+        op.getOutputZeroPoint(outputZpVal).failed()) {
+      (void)rewriter.notifyMatchFailure(
----------------
FranklandJack wrote:

I think `notifyMathFailure()` returns a `failure()`, so we could probably remove the `(void)` cast here and just return the result of the function call?

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


More information about the Mlir-commits mailing list