From: Adrian Kuegel Date: Mon, 29 Aug 2022 07:15:35 +0000 (+0200) Subject: [mlir] Apply ClangTidy performance finding (NFC). X-Git-Tag: upstream/17.0.6~35087 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0568fa763516747914207a68c0266e2101e57e2;p=platform%2Fupstream%2Fllvm.git [mlir] Apply ClangTidy performance finding (NFC). --- diff --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp index e5040a4..55ce5ea 100644 --- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp @@ -452,7 +452,7 @@ tileLinalgOpImpl(RewriterBase &b, LinalgOp op, ArrayRef tileSizes, linalg::ProcInfo{nullptr, nullptr, linalg::DistributionMethod::None}); // Collect loop ranges of tiled loopss, loops that are parallel. SmallVector 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 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++];