[Mlir-commits] [mlir] [mlir][tosa] Change MatMul zero-point to inputs (PR #129785)

Tai Ly llvmlistbot at llvm.org
Wed Mar 5 10:21:43 PST 2025


================
@@ -621,15 +621,38 @@ class MatMulConverter : public OpConversionPattern<tosa::MatMulOp> {
                            .create<linalg::FillOp>(loc, ValueRange{zero},
                                                    ValueRange{emptyTensor})
                            .result();
-    if (!op.getAZp() && !op.getBZp()) {
+
+    FailureOr<int64_t> maybeAZp = op.getAZeroPoint();
+    FailureOr<int64_t> maybeBZp = op.getBZeroPoint();
+    if (failed(maybeAZp))
+      return rewriter.notifyMatchFailure(
+          op, "input a zero point cannot be statically determined");
+    if (failed(maybeBZp))
+      return rewriter.notifyMatchFailure(
+          op, "input b zero point cannot be statically determined");
+
+    int64_t aZpVal = *maybeAZp;
----------------
Tai78641 wrote:

fixed this and other similar zp val lines

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


More information about the Mlir-commits mailing list