[mlir] Apply ClangTidy performance finding.
authorAdrian Kuegel <akuegel@google.com>
Tue, 4 Oct 2022 12:07:39 +0000 (14:07 +0200)
committerAdrian Kuegel <akuegel@google.com>
Tue, 4 Oct 2022 12:07:39 +0000 (14:07 +0200)
loop variable is copied but only used as const reference.

mlir/test/lib/Interfaces/TilingInterface/TestTilingInterface.cpp

index edb7ba3..977a054 100644 (file)
@@ -116,7 +116,7 @@ struct TestTileConsumerAndFuseProducersGreedilyUsingSCFForOp
     }
     // Replace the tiled op with replacements.
     SmallVector<Value> replacements(op->getNumResults());
-    for (auto result : llvm::enumerate(op->getResults())) {
+    for (const auto &result : llvm::enumerate(op->getResults())) {
       replacements[result.index()] =
           tileAndFuseResult->replacements.lookup(result.value());
     }