[Mlir-commits] [mlir] 5cd0d3c - [MLIR] Apply clang-tidy fixes for performance-unnecessary-value-param in DialectQuant.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Sat Aug 23 13:00:43 PDT 2025


Author: Mehdi Amini
Date: 2025-08-23T12:58:09-07:00
New Revision: 5cd0d3c6bdd38c2c84ec3fe79e19d2d501551437

URL: https://github.com/llvm/llvm-project/commit/5cd0d3c6bdd38c2c84ec3fe79e19d2d501551437
DIFF: https://github.com/llvm/llvm-project/commit/5cd0d3c6bdd38c2c84ec3fe79e19d2d501551437.diff

LOG: [MLIR] Apply clang-tidy fixes for performance-unnecessary-value-param in DialectQuant.cpp (NFC)

Added: 
    

Modified: 
    mlir/lib/Bindings/Python/DialectQuant.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Bindings/Python/DialectQuant.cpp b/mlir/lib/Bindings/Python/DialectQuant.cpp
index 55571cd1e50a6..a5220fcc00604 100644
--- a/mlir/lib/Bindings/Python/DialectQuant.cpp
+++ b/mlir/lib/Bindings/Python/DialectQuant.cpp
@@ -165,7 +165,7 @@ static void populateDialectQuantSubmodule(const nb::module_ &m) {
                          quantizedType.get_class());
   anyQuantizedType.def_classmethod(
       "get",
-      [](nb::object cls, unsigned flags, MlirType storageType,
+      [](const nb::object &cls, unsigned flags, MlirType storageType,
          MlirType expressedType, int64_t storageTypeMin,
          int64_t storageTypeMax) {
         return cls(mlirAnyQuantizedTypeGet(flags, storageType, expressedType,
@@ -186,7 +186,7 @@ static void populateDialectQuantSubmodule(const nb::module_ &m) {
       quantizedType.get_class());
   uniformQuantizedType.def_classmethod(
       "get",
-      [](nb::object cls, unsigned flags, MlirType storageType,
+      [](const nb::object &cls, unsigned flags, MlirType storageType,
          MlirType expressedType, double scale, int64_t zeroPoint,
          int64_t storageTypeMin, int64_t storageTypeMax) {
         return cls(mlirUniformQuantizedTypeGet(flags, storageType,
@@ -221,7 +221,7 @@ static void populateDialectQuantSubmodule(const nb::module_ &m) {
       quantizedType.get_class());
   uniformQuantizedPerAxisType.def_classmethod(
       "get",
-      [](nb::object cls, unsigned flags, MlirType storageType,
+      [](const nb::object &cls, unsigned flags, MlirType storageType,
          MlirType expressedType, std::vector<double> scales,
          std::vector<int64_t> zeroPoints, int32_t quantizedDimension,
          int64_t storageTypeMin, int64_t storageTypeMax) {
@@ -293,7 +293,7 @@ static void populateDialectQuantSubmodule(const nb::module_ &m) {
       mlirTypeIsAUniformQuantizedSubChannelType, quantizedType.get_class());
   uniformQuantizedSubChannelType.def_classmethod(
       "get",
-      [](nb::object cls, unsigned flags, MlirType storageType,
+      [](const nb::object &cls, unsigned flags, MlirType storageType,
          MlirType expressedType, MlirAttribute scales, MlirAttribute zeroPoints,
          std::vector<int32_t> quantizedDimensions,
          std::vector<int64_t> blockSizes, int64_t storageTypeMin,
@@ -367,7 +367,8 @@ static void populateDialectQuantSubmodule(const nb::module_ &m) {
       quantizedType.get_class());
   calibratedQuantizedType.def_classmethod(
       "get",
-      [](nb::object cls, MlirType expressedType, double min, double max) {
+      [](const nb::object &cls, MlirType expressedType, double min,
+         double max) {
         return cls(mlirCalibratedQuantizedTypeGet(expressedType, min, max));
       },
       "Gets an instance of CalibratedQuantizedType in the same context as the "


        


More information about the Mlir-commits mailing list