[Mlir-commits] [mlir] [mlir][tosa] Remove Quantization Attribute (PR #125479)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Feb 3 03:10:36 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 50d5d06d383616b88a71512d58b0f5bf365d921b babe874e1e78ee76da93bbc307e7485088bd95fb --extensions cpp -- mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp mlir/lib/Conversion/TosaToSCF/TosaToSCF.cpp mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp mlir/lib/Dialect/Tosa/IR/TosaOps.cpp mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeConv2D.cpp mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeTransposeConv.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
index 1e02301f7c..6321cb6087 100644
--- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
+++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
@@ -670,7 +670,8 @@ public:
     }
 
     auto inputZp = rewriter.create<arith::ConstantOp>(loc, op.getInputZpAttr());
-    auto outputZp = rewriter.create<arith::ConstantOp>(loc, op.getWeightZpAttr());
+    auto outputZp =
+        rewriter.create<arith::ConstantOp>(loc, op.getWeightZpAttr());
     Value matmul =
         rewriter
             .create<linalg::QuantizedMatmulOp>(
@@ -953,8 +954,8 @@ public:
             // If we have quantization information we need to apply an offset
             // for the input zp value.
             if (op.getInputZp()) {
-              auto inputZp = rewriter.create<arith::ConstantOp>(
-                  loc, op.getInputZpAttr());
+              auto inputZp =
+                  rewriter.create<arith::ConstantOp>(loc, op.getInputZpAttr());
               Value offset =
                   rewriter.create<arith::MulIOp>(loc, accETy, count, inputZp);
               poolVal =

``````````

</details>


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


More information about the Mlir-commits mailing list