Skip to content

Commit 4e888e2

Browse files
committed
[MLIR] NFC. Fix clang-tidy warnings in Affine Utils
1 parent 0fcaca2 commit 4e888e2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

mlir/lib/Dialect/Affine/Utils/Utils.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,20 +1431,18 @@ void mlir::affine::createAffineComputationSlice(
14311431
// differ from opInst's operands only for those operands in 'subOperands', for
14321432
// which they will be replaced by the corresponding one from 'sliceOps'.
14331433
SmallVector<Value, 4> newOperands(opInst->getOperands());
1434-
for (unsigned i = 0, e = newOperands.size(); i < e; i++) {
1434+
for (Value &operand : newOperands) {
14351435
// Replace the subOperands from among the new operands.
14361436
unsigned j, f;
14371437
for (j = 0, f = subOperands.size(); j < f; j++) {
1438-
if (newOperands[i] == subOperands[j])
1438+
if (operand == subOperands[j])
14391439
break;
14401440
}
1441-
if (j < subOperands.size()) {
1442-
newOperands[i] = (*sliceOps)[j];
1443-
}
1441+
if (j < subOperands.size())
1442+
operand = (*sliceOps)[j];
14441443
}
1445-
for (unsigned idx = 0, e = newOperands.size(); idx < e; idx++) {
1444+
for (unsigned idx = 0, e = newOperands.size(); idx < e; idx++)
14461445
opInst->setOperand(idx, newOperands[idx]);
1447-
}
14481446
}
14491447

14501448
/// Enum to set patterns of affine expr in tiled-layout map.

0 commit comments

Comments
 (0)