[mlir] Apply ClangTidy performance finding (NFC).
authorAdrian Kuegel <akuegel@google.com>
Mon, 29 Aug 2022 07:15:35 +0000 (09:15 +0200)
committerAdrian Kuegel <akuegel@google.com>
Mon, 29 Aug 2022 07:15:35 +0000 (09:15 +0200)
mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp

index e5040a4..55ce5ea 100644 (file)
@@ -452,7 +452,7 @@ tileLinalgOpImpl(RewriterBase &b, LinalgOp op, ArrayRef<OpFoldResult> tileSizes,
         linalg::ProcInfo{nullptr, nullptr, linalg::DistributionMethod::None});
     // Collect loop ranges of tiled loopss, loops that are parallel.
     SmallVector<Range> parallelLoopRanges;
-    for (auto iteratorType : llvm::enumerate(iteratorTypes)) {
+    for (const auto &iteratorType : llvm::enumerate(iteratorTypes)) {
       if (!isParallelIterator(iteratorType.value()))
         break;
       parallelLoopRanges.push_back(loopRanges[iteratorType.index()]);
@@ -461,7 +461,7 @@ tileLinalgOpImpl(RewriterBase &b, LinalgOp op, ArrayRef<OpFoldResult> tileSizes,
         options.distribution->procInfo(b, op.getLoc(), parallelLoopRanges);
     unsigned procIdIdx = 0;
     // Update the distribution information for the loops.
-    for (auto iteratorType : llvm::enumerate(iteratorTypes)) {
+    for (const auto &iteratorType : llvm::enumerate(iteratorTypes)) {
       if (!isParallelIterator(iteratorType.value()))
         break;
       procInfo[iteratorType.index()] = returnedProcInfo[procIdIdx++];