Apply clang-tidy fixes for performance-unnecessary-value-param in VectorDistribute.cpp (NFC)

This commit is contained in:
Mehdi Amini 2022-06-12 18:05:22 +00:00
parent b254d55711
commit 08d651d7ba
2 changed files with 5 additions and 3 deletions

View File

@ -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.

View File

@ -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);
}