[Mlir-commits] [mlir] 63d69a2 - Apply clang-tidy fixes for performance-unnecessary-value-param in Utils.cpp (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Mon May 23 16:13:57 PDT 2022
Author: Mehdi Amini
Date: 2022-05-23T23:12:58Z
New Revision: 63d69a21b7a7c07c0004823fb68a58a439adbc84
URL: https://github.com/llvm/llvm-project/commit/63d69a21b7a7c07c0004823fb68a58a439adbc84
DIFF: https://github.com/llvm/llvm-project/commit/63d69a21b7a7c07c0004823fb68a58a439adbc84.diff
LOG: Apply clang-tidy fixes for performance-unnecessary-value-param in Utils.cpp (NFC)
Added:
Modified:
mlir/include/mlir/Dialect/SCF/Utils/Utils.h
mlir/lib/Dialect/SCF/Utils/Utils.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/SCF/Utils/Utils.h b/mlir/include/mlir/Dialect/SCF/Utils/Utils.h
index 95df92e2edc6c..09032cb679a8c 100644
--- a/mlir/include/mlir/Dialect/SCF/Utils/Utils.h
+++ b/mlir/include/mlir/Dialect/SCF/Utils/Utils.h
@@ -54,7 +54,7 @@ using NewYieldValueFn = std::function<SmallVector<Value>(
OpBuilder &b, Location loc, ArrayRef<BlockArgument> newBBArgs)>;
scf::ForOp replaceLoopWithNewYields(OpBuilder &builder, scf::ForOp loop,
ValueRange newIterOperands,
- NewYieldValueFn newYieldValuesFn);
+ const NewYieldValueFn &newYieldValuesFn);
/// Outline a region with a single block into a new FuncOp.
/// Assumes the FuncOp result types is the type of the yielded operands of the
diff --git a/mlir/lib/Dialect/SCF/Utils/Utils.cpp b/mlir/lib/Dialect/SCF/Utils/Utils.cpp
index d4c96e51d549a..0910cb31f13cb 100644
--- a/mlir/lib/Dialect/SCF/Utils/Utils.cpp
+++ b/mlir/lib/Dialect/SCF/Utils/Utils.cpp
@@ -36,9 +36,10 @@ struct LoopParams {
};
} // namespace
-scf::ForOp mlir::replaceLoopWithNewYields(OpBuilder &builder, scf::ForOp loop,
- ValueRange newIterOperands,
- NewYieldValueFn newYieldValuesFn) {
+scf::ForOp
+mlir::replaceLoopWithNewYields(OpBuilder &builder, scf::ForOp loop,
+ ValueRange newIterOperands,
+ const NewYieldValueFn &newYieldValuesFn) {
// Create a new loop before the existing one, with the extra operands.
OpBuilder::InsertionGuard g(builder);
builder.setInsertionPoint(loop);
More information about the Mlir-commits
mailing list