Skip to content

Commit 5123dfb

Browse files
committed
[MLIR] Apply clang-tidy fixes for performance-unnecessary-value-param in ReifyValueBounds.cpp (NFC)
1 parent 048922e commit 5123dfb

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

mlir/include/mlir/Dialect/Arith/Transforms/Transforms.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ reifyValueBound(OpBuilder &b, Location loc, presburger::BoundType type,
5353
/// ValueBoundsOpInterface, no bound can be computed.
5454
FailureOr<OpFoldResult> reifyIndexValueBound(
5555
OpBuilder &b, Location loc, presburger::BoundType type, Value value,
56-
ValueBoundsConstraintSet::StopConditionFn stopCondition = nullptr,
56+
const ValueBoundsConstraintSet::StopConditionFn &stopCondition = nullptr,
5757
bool closedUB = false);
5858

5959
/// Reify a bound for the specified dimension of the given shaped value in terms
@@ -65,7 +65,7 @@ FailureOr<OpFoldResult> reifyIndexValueBound(
6565
FailureOr<OpFoldResult> reifyShapedValueDimBound(
6666
OpBuilder &b, Location loc, presburger::BoundType type, Value value,
6767
int64_t dim,
68-
ValueBoundsConstraintSet::StopConditionFn stopCondition = nullptr,
68+
const ValueBoundsConstraintSet::StopConditionFn &stopCondition = nullptr,
6969
bool closedUB = false);
7070

7171
} // namespace arith

mlir/lib/Dialect/Arith/Transforms/ReifyValueBounds.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#include <utility>
10+
911
#include "mlir/Dialect/Arith/Transforms/Transforms.h"
1012

1113
#include "mlir/Dialect/Arith/IR/Arith.h"
@@ -69,7 +71,8 @@ FailureOr<OpFoldResult> mlir::arith::reifyValueBound(
6971
AffineMap boundMap;
7072
ValueDimList mapOperands;
7173
if (failed(ValueBoundsConstraintSet::computeBound(
72-
boundMap, mapOperands, type, var, stopCondition, closedUB)))
74+
boundMap, mapOperands, type, var, std::move(stopCondition),
75+
closedUB)))
7376
return failure();
7477

7578
// Materialize tensor.dim/memref.dim ops.
@@ -116,7 +119,7 @@ FailureOr<OpFoldResult> mlir::arith::reifyValueBound(
116119

117120
FailureOr<OpFoldResult> mlir::arith::reifyShapedValueDimBound(
118121
OpBuilder &b, Location loc, presburger::BoundType type, Value value,
119-
int64_t dim, ValueBoundsConstraintSet::StopConditionFn stopCondition,
122+
int64_t dim, const ValueBoundsConstraintSet::StopConditionFn &stopCondition,
120123
bool closedUB) {
121124
auto reifyToOperands = [&](Value v, std::optional<int64_t> d,
122125
ValueBoundsConstraintSet &cstr) {
@@ -134,7 +137,8 @@ FailureOr<OpFoldResult> mlir::arith::reifyShapedValueDimBound(
134137

135138
FailureOr<OpFoldResult> mlir::arith::reifyIndexValueBound(
136139
OpBuilder &b, Location loc, presburger::BoundType type, Value value,
137-
ValueBoundsConstraintSet::StopConditionFn stopCondition, bool closedUB) {
140+
const ValueBoundsConstraintSet::StopConditionFn &stopCondition,
141+
bool closedUB) {
138142
auto reifyToOperands = [&](Value v, std::optional<int64_t> d,
139143
ValueBoundsConstraintSet &cstr) {
140144
return v != value;

0 commit comments

Comments
 (0)