[Mlir-commits] [mlir] 2a6f0fb - Apply clang-tidy fixes for performance-for-range-copy in TileUsingInterface.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Tue Oct 11 22:04:06 PDT 2022


Author: Mehdi Amini
Date: 2022-10-12T05:03:45Z
New Revision: 2a6f0fb34a734f6a86283e2dcee687dbab53c8db

URL: https://github.com/llvm/llvm-project/commit/2a6f0fb34a734f6a86283e2dcee687dbab53c8db
DIFF: https://github.com/llvm/llvm-project/commit/2a6f0fb34a734f6a86283e2dcee687dbab53c8db.diff

LOG: Apply clang-tidy fixes for performance-for-range-copy in TileUsingInterface.cpp (NFC)

Added: 
    

Modified: 
    mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
index 2630da381b38..2003b5e3cded 100644
--- a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
@@ -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()];
@@ -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()],
@@ -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());


        


More information about the Mlir-commits mailing list