Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC)
authorMehdi Amini <joker.eph@gmail.com>
Mon, 7 Mar 2022 10:12:46 +0000 (10:12 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 7 Mar 2022 10:41:45 +0000 (10:41 +0000)
mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h
mlir/include/mlir/Dialect/Linalg/Utils/Utils.h
mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp
mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp

index 1e75872..367c523 100644 (file)
@@ -239,7 +239,7 @@ struct BufferizationOptions {
 
   /// Add a bufferization state initializer that initializes the specified
   /// dialect-specific bufferization state.
-  void addDialectStateInitializer(StringRef name, DialectStateInitFn fn);
+  void addDialectStateInitializer(StringRef name, const DialectStateInitFn &fn);
 
 private:
   /// Allow a dialect.
index 1d72b9a..e53b25c 100644 (file)
@@ -397,7 +397,7 @@ private:
 FailureOr<TileLoopNest> tileConsumerAndFuseProducers(
     OpBuilder &b, LinalgOp consumerOp, ArrayRef<int64_t> tileSizes,
     ArrayRef<int64_t> tileInterchange,
-    Optional<LinalgLoopDistributionOptions> tileDistribution);
+    const Optional<LinalgLoopDistributionOptions> &tileDistribution);
 
 //===----------------------------------------------------------------------===//
 // Generic op region utilities
index 34aae64..62a6f8f 100644 (file)
@@ -1862,8 +1862,8 @@ LogicalResult arith::SelectOp::verify() {
 OpFoldResult arith::ShLIOp::fold(ArrayRef<Attribute> operands) {
   // Don't fold if shifting more than the bit width.
   bool bounded = false;
-  auto result =
-      constFoldBinaryOp<IntegerAttr>(operands, [&](APInt a, const APInt &b) {
+  auto result = constFoldBinaryOp<IntegerAttr>(
+      operands, [&](const APInt &a, const APInt &b) {
         bounded = b.ule(b.getBitWidth());
         return std::move(a).shl(b);
       });
index 3e0e89a..7fd538c 100644 (file)
@@ -64,8 +64,8 @@ BufferizationOptions::dynCastBufferizableOp(Value value) const {
   return nullptr;
 }
 
-void BufferizationOptions::addDialectStateInitializer(StringRef name,
-                                                      DialectStateInitFn fn) {
+void BufferizationOptions::addDialectStateInitializer(
+    StringRef name, const DialectStateInitFn &fn) {
   stateInitializers.push_back(
       [=](BufferizationState &state) { state.insertDialectState(name, fn()); });
 }
index 1f1e9e8..f1b1d97 100644 (file)
@@ -40,7 +40,7 @@ struct LinalgComprehensiveModuleBufferize
       const LinalgComprehensiveModuleBufferize &p) = default;
 
   explicit LinalgComprehensiveModuleBufferize(
-      AnalysisBufferizationOptions options)
+      const AnalysisBufferizationOptions &options)
       : options(options) {}
 
   void runOnOperation() override;
index 25808ed..4297a83 100644 (file)
@@ -415,7 +415,7 @@ SmallVector<LinalgOp> TileLoopNest::getAllTiledAndFusedOps() {
 FailureOr<TileLoopNest> mlir::linalg::tileConsumerAndFuseProducers(
     OpBuilder &b, LinalgOp consumerOp, ArrayRef<int64_t> tileSizes,
     ArrayRef<int64_t> tileInterchange,
-    Optional<LinalgLoopDistributionOptions> tileDistribution) {
+    const Optional<LinalgLoopDistributionOptions> &tileDistribution) {
   assert(tileSizes.size() == tileInterchange.size() &&
          "expect the number of tile sizes and interchange dims to match");
   assert(isPermutation(tileInterchange) &&