[Mlir-commits] [mlir] 08d651d - Apply clang-tidy fixes for performance-unnecessary-value-param in VectorDistribute.cpp (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Tue Jun 28 12:53:14 PDT 2022
Author: Mehdi Amini
Date: 2022-06-28T19:52:46Z
New Revision: 08d651d7bad051a1a6691562c3ee384ab90dfa64
URL: https://github.com/llvm/llvm-project/commit/08d651d7bad051a1a6691562c3ee384ab90dfa64
DIFF: https://github.com/llvm/llvm-project/commit/08d651d7bad051a1a6691562c3ee384ab90dfa64.diff
LOG: Apply clang-tidy fixes for performance-unnecessary-value-param in VectorDistribute.cpp (NFC)
Added:
Modified:
mlir/include/mlir/Dialect/Vector/Transforms/VectorDistribution.h
mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Vector/Transforms/VectorDistribution.h b/mlir/include/mlir/Dialect/Vector/Transforms/VectorDistribution.h
index 121a7222222d3..d3220ceb43f67 100644
--- a/mlir/include/mlir/Dialect/Vector/Transforms/VectorDistribution.h
+++ b/mlir/include/mlir/Dialect/Vector/Transforms/VectorDistribution.h
@@ -59,7 +59,7 @@ using DistributionMapFn = std::function<AffineMap(vector::TransferWriteOp)>;
/// }
/// vector.transfer_write %v, %A[%id] : vector<1xf32>, memref<128xf32>
void populateDistributeTransferWriteOpPatterns(
- RewritePatternSet &patterns, DistributionMapFn distributionMapFn);
+ RewritePatternSet &patterns, const DistributionMapFn &distributionMapFn);
/// Move scalar operations with no dependency on the warp op outside of the
/// region.
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
index e8602af2a9e56..08eced2bd935e 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
@@ -15,6 +15,8 @@
#include "mlir/IR/BlockAndValueMapping.h"
#include "mlir/Transforms/SideEffectUtils.h"
+#include <utility>
+
using namespace mlir;
using namespace mlir::vector;
@@ -281,7 +283,7 @@ struct WarpOpTransferWrite : public OpRewritePattern<vector::TransferWriteOp> {
WarpOpTransferWrite(MLIRContext *ctx, DistributionMapFn fn,
PatternBenefit b = 1)
: OpRewritePattern<vector::TransferWriteOp>(ctx, b),
- distributionMapFn(fn) {}
+ distributionMapFn(std::move(fn)) {}
/// Distribute the TransferWriteOp. Only 1D distributions and vector dims that
/// are multiples of the distribution ratio are supported at the moment.
@@ -815,7 +817,7 @@ void mlir::vector::populateWarpExecuteOnLane0OpToScfForPattern(
}
void mlir::vector::populateDistributeTransferWriteOpPatterns(
- RewritePatternSet &patterns, DistributionMapFn distributionMapFn) {
+ RewritePatternSet &patterns, const DistributionMapFn &distributionMapFn) {
patterns.add<WarpOpTransferWrite>(patterns.getContext(), distributionMapFn);
}
More information about the Mlir-commits
mailing list