Skip to content

Commit

Permalink
Apply clang-tidy fixes for performance-for-range-copy in TileUsingInt…
Browse files Browse the repository at this point in the history
…erface.cpp (NFC)
  • Loading branch information
joker-eph committed Oct 12, 2022
1 parent 735b22d commit 2a6f0fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ yieldTiledValues(RewriterBase &rewriter, ValueRange initValues,
[&](OpBuilder &b, Location loc,
ArrayRef<BlockArgument> newBBArgs) -> SmallVector<Value> {
SmallVector<Value> inserts;
for (auto yieldedValue : llvm::enumerate(yieldedValues)) {
for (const auto &yieldedValue : llvm::enumerate(yieldedValues)) {
ArrayRef<OpFoldResult> tileOffsets =
tileOffsetsList[yieldedValue.index()];
ArrayRef<OpFoldResult> tileSizes = tileSizesList[yieldedValue.index()];
Expand Down Expand Up @@ -368,7 +368,7 @@ mlir::scf::tileUsingSCFForOp(RewriterBase &rewriter, TilingInterface op,
int64_t numResults = op->getNumResults();
SmallVector<SmallVector<OpFoldResult>> resultOffsetsList(numResults),
resultSizesList(numResults);
for (auto result : llvm::enumerate(op->getResults())) {
for (const auto &result : llvm::enumerate(op->getResults())) {
if (failed(op.getResultTilePosition(rewriter, result.index(), offsets,
sizes,
resultOffsetsList[result.index()],
Expand Down Expand Up @@ -451,7 +451,7 @@ mlir::scf::tileConsumerAndFuseProducerGreedilyUsingSCFForOp(
return rewriter.notifyMatchFailure(consumer, "failed to tile consumer");
tileAndFuseResult.tiledAndFusedOps.insert(tilingResult->tiledOp);
tileAndFuseResult.loops = std::move(tilingResult->loops);
for (auto result : llvm::enumerate(
for (const auto &result : llvm::enumerate(
llvm::zip(consumer->getResults(), tilingResult->replacements))) {
tileAndFuseResult.replacements[std::get<0>(result.value())] =
std::get<1>(result.value());
Expand Down

0 comments on commit 2a6f0fb

Please sign in to comment.