[Mlir-commits] [mlir] 5123dfb - [MLIR] Apply clang-tidy fixes for performance-unnecessary-value-param in ReifyValueBounds.cpp (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Tue Sep 30 02:08:25 PDT 2025
Author: Mehdi Amini
Date: 2025-09-30T02:08:00-07:00
New Revision: 5123dfb51722a5075b3515c49930216869f595d6
URL: https://github.com/llvm/llvm-project/commit/5123dfb51722a5075b3515c49930216869f595d6
DIFF: https://github.com/llvm/llvm-project/commit/5123dfb51722a5075b3515c49930216869f595d6.diff
LOG: [MLIR] Apply clang-tidy fixes for performance-unnecessary-value-param in ReifyValueBounds.cpp (NFC)
Added:
Modified:
mlir/include/mlir/Dialect/Arith/Transforms/Transforms.h
mlir/lib/Dialect/Arith/Transforms/ReifyValueBounds.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Arith/Transforms/Transforms.h b/mlir/include/mlir/Dialect/Arith/Transforms/Transforms.h
index 8d6c68cef680d..ffd367ef11abc 100644
--- a/mlir/include/mlir/Dialect/Arith/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/Arith/Transforms/Transforms.h
@@ -53,7 +53,7 @@ reifyValueBound(OpBuilder &b, Location loc, presburger::BoundType type,
/// ValueBoundsOpInterface, no bound can be computed.
FailureOr<OpFoldResult> reifyIndexValueBound(
OpBuilder &b, Location loc, presburger::BoundType type, Value value,
- ValueBoundsConstraintSet::StopConditionFn stopCondition = nullptr,
+ const ValueBoundsConstraintSet::StopConditionFn &stopCondition = nullptr,
bool closedUB = false);
/// Reify a bound for the specified dimension of the given shaped value in terms
@@ -65,7 +65,7 @@ FailureOr<OpFoldResult> reifyIndexValueBound(
FailureOr<OpFoldResult> reifyShapedValueDimBound(
OpBuilder &b, Location loc, presburger::BoundType type, Value value,
int64_t dim,
- ValueBoundsConstraintSet::StopConditionFn stopCondition = nullptr,
+ const ValueBoundsConstraintSet::StopConditionFn &stopCondition = nullptr,
bool closedUB = false);
} // namespace arith
diff --git a/mlir/lib/Dialect/Arith/Transforms/ReifyValueBounds.cpp b/mlir/lib/Dialect/Arith/Transforms/ReifyValueBounds.cpp
index 4bdd1e6a54d69..127563c8f4967 100644
--- a/mlir/lib/Dialect/Arith/Transforms/ReifyValueBounds.cpp
+++ b/mlir/lib/Dialect/Arith/Transforms/ReifyValueBounds.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+#include <utility>
+
#include "mlir/Dialect/Arith/Transforms/Transforms.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
@@ -69,7 +71,8 @@ FailureOr<OpFoldResult> mlir::arith::reifyValueBound(
AffineMap boundMap;
ValueDimList mapOperands;
if (failed(ValueBoundsConstraintSet::computeBound(
- boundMap, mapOperands, type, var, stopCondition, closedUB)))
+ boundMap, mapOperands, type, var, std::move(stopCondition),
+ closedUB)))
return failure();
// Materialize tensor.dim/memref.dim ops.
@@ -116,7 +119,7 @@ FailureOr<OpFoldResult> mlir::arith::reifyValueBound(
FailureOr<OpFoldResult> mlir::arith::reifyShapedValueDimBound(
OpBuilder &b, Location loc, presburger::BoundType type, Value value,
- int64_t dim, ValueBoundsConstraintSet::StopConditionFn stopCondition,
+ int64_t dim, const ValueBoundsConstraintSet::StopConditionFn &stopCondition,
bool closedUB) {
auto reifyToOperands = [&](Value v, std::optional<int64_t> d,
ValueBoundsConstraintSet &cstr) {
@@ -134,7 +137,8 @@ FailureOr<OpFoldResult> mlir::arith::reifyShapedValueDimBound(
FailureOr<OpFoldResult> mlir::arith::reifyIndexValueBound(
OpBuilder &b, Location loc, presburger::BoundType type, Value value,
- ValueBoundsConstraintSet::StopConditionFn stopCondition, bool closedUB) {
+ const ValueBoundsConstraintSet::StopConditionFn &stopCondition,
+ bool closedUB) {
auto reifyToOperands = [&](Value v, std::optional<int64_t> d,
ValueBoundsConstraintSet &cstr) {
return v != value;
More information about the Mlir-commits
mailing list