Skip to content

Commit c1d36e2

Browse files
committed
[mlir][SCF] Apply suggested ClangTidy fixes.
1 parent 4101aa1 commit c1d36e2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mlir/lib/Dialect/SCF/SCF.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -2406,7 +2406,8 @@ struct RemoveLoopInvariantArgsFromBeforeBlock
24062406
ValueRange yieldOpArgs = yieldOp->getOperands();
24072407

24082408
bool canSimplify = false;
2409-
for (auto it : llvm::enumerate(llvm::zip(op.getOperands(), yieldOpArgs))) {
2409+
for (const auto &it :
2410+
llvm::enumerate(llvm::zip(op.getOperands(), yieldOpArgs))) {
24102411
auto index = static_cast<unsigned>(it.index());
24112412
Value initVal, yieldOpArg;
24122413
std::tie(initVal, yieldOpArg) = it.value();
@@ -2437,7 +2438,8 @@ struct RemoveLoopInvariantArgsFromBeforeBlock
24372438
SmallVector<Value> newInitArgs, newYieldOpArgs;
24382439
DenseMap<unsigned, Value> beforeBlockInitValMap;
24392440
SmallVector<Location> newBeforeBlockArgLocs;
2440-
for (auto it : llvm::enumerate(llvm::zip(op.getOperands(), yieldOpArgs))) {
2441+
for (const auto &it :
2442+
llvm::enumerate(llvm::zip(op.getOperands(), yieldOpArgs))) {
24412443
auto index = static_cast<unsigned>(it.index());
24422444
Value initVal, yieldOpArg;
24432445
std::tie(initVal, yieldOpArg) = it.value();
@@ -2574,7 +2576,7 @@ struct RemoveLoopInvariantValueYielded : public OpRewritePattern<WhileOp> {
25742576
SmallVector<Type> newAfterBlockType;
25752577
DenseMap<unsigned, Value> condOpInitValMap;
25762578
SmallVector<Location> newAfterBlockArgLocs;
2577-
for (auto it : llvm::enumerate(condOpArgs)) {
2579+
for (const auto &it : llvm::enumerate(condOpArgs)) {
25782580
auto index = static_cast<unsigned>(it.index());
25792581
Value condOpArg = it.value();
25802582
// Those values not defined within `before` block will be considered as

0 commit comments

Comments
 (0)