Skip to content

Commit

Permalink
Apply clang-tidy fixes for performance-unnecessary-value-param in Vec…
Browse files Browse the repository at this point in the history
…torDistribute.cpp (NFC)
  • Loading branch information
joker-eph committed Jun 28, 2022
1 parent b254d55 commit 08d651d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
Expand Up @@ -15,6 +15,8 @@
#include "mlir/IR/BlockAndValueMapping.h"
#include "mlir/Transforms/SideEffectUtils.h"

#include <utility>

using namespace mlir;
using namespace mlir::vector;

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 08d651d

Please sign in to comment.