Skip to content

Commit 51894cb

Browse files
committed
Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC)
1 parent cc96d2d commit 51894cb

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ struct BufferizationOptions {
239239

240240
/// Add a bufferization state initializer that initializes the specified
241241
/// dialect-specific bufferization state.
242-
void addDialectStateInitializer(StringRef name, DialectStateInitFn fn);
242+
void addDialectStateInitializer(StringRef name, const DialectStateInitFn &fn);
243243

244244
private:
245245
/// Allow a dialect.

mlir/include/mlir/Dialect/Linalg/Utils/Utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ class TileLoopNest {
397397
FailureOr<TileLoopNest> tileConsumerAndFuseProducers(
398398
OpBuilder &b, LinalgOp consumerOp, ArrayRef<int64_t> tileSizes,
399399
ArrayRef<int64_t> tileInterchange,
400-
Optional<LinalgLoopDistributionOptions> tileDistribution);
400+
const Optional<LinalgLoopDistributionOptions> &tileDistribution);
401401

402402
//===----------------------------------------------------------------------===//
403403
// Generic op region utilities

mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,8 +1862,8 @@ LogicalResult arith::SelectOp::verify() {
18621862
OpFoldResult arith::ShLIOp::fold(ArrayRef<Attribute> operands) {
18631863
// Don't fold if shifting more than the bit width.
18641864
bool bounded = false;
1865-
auto result =
1866-
constFoldBinaryOp<IntegerAttr>(operands, [&](APInt a, const APInt &b) {
1865+
auto result = constFoldBinaryOp<IntegerAttr>(
1866+
operands, [&](const APInt &a, const APInt &b) {
18671867
bounded = b.ule(b.getBitWidth());
18681868
return std::move(a).shl(b);
18691869
});

mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ BufferizationOptions::dynCastBufferizableOp(Value value) const {
6464
return nullptr;
6565
}
6666

67-
void BufferizationOptions::addDialectStateInitializer(StringRef name,
68-
DialectStateInitFn fn) {
67+
void BufferizationOptions::addDialectStateInitializer(
68+
StringRef name, const DialectStateInitFn &fn) {
6969
stateInitializers.push_back(
7070
[=](BufferizationState &state) { state.insertDialectState(name, fn()); });
7171
}

mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct LinalgComprehensiveModuleBufferize
4040
const LinalgComprehensiveModuleBufferize &p) = default;
4141

4242
explicit LinalgComprehensiveModuleBufferize(
43-
AnalysisBufferizationOptions options)
43+
const AnalysisBufferizationOptions &options)
4444
: options(options) {}
4545

4646
void runOnOperation() override;

mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ SmallVector<LinalgOp> TileLoopNest::getAllTiledAndFusedOps() {
415415
FailureOr<TileLoopNest> mlir::linalg::tileConsumerAndFuseProducers(
416416
OpBuilder &b, LinalgOp consumerOp, ArrayRef<int64_t> tileSizes,
417417
ArrayRef<int64_t> tileInterchange,
418-
Optional<LinalgLoopDistributionOptions> tileDistribution) {
418+
const Optional<LinalgLoopDistributionOptions> &tileDistribution) {
419419
assert(tileSizes.size() == tileInterchange.size() &&
420420
"expect the number of tile sizes and interchange dims to match");
421421
assert(isPermutation(tileInterchange) &&

0 commit comments

Comments
 (0)