[mlir][Linalg] Apply ClangTidy performance finding.

Loop variable is copied but only used as const reference.
This commit is contained in:
Adrian Kuegel 2022-09-02 10:57:28 +02:00
parent 1334e129a3
commit 3730658ed9
1 changed files with 2 additions and 2 deletions

View File

@ -502,7 +502,7 @@ void GenerateLoopNest<scf::ForOp>::doit(
return;
// Filter out scf.for loops that were created out of parallel dimensions.
for (auto loop : llvm::enumerate(loopNest.loops)) {
for (const auto &loop : llvm::enumerate(loopNest.loops)) {
if (procInfo[loop.index()].distributionMethod ==
DistributionMethod::Cyclic) {
mapLoopToProcessorIds(loop.value(), procInfo[loop.index()].procId,
@ -704,7 +704,7 @@ void GenerateLoopNest<scf::ParallelOp>::doit(
unpackRanges(b, loc, loopRanges, lbsStorage, ubsStorage, stepsStorage);
// Modify the lb, ub, and step based on the distribution options.
for (auto it : llvm::enumerate(procInfo)) {
for (const auto &it : llvm::enumerate(procInfo)) {
if (it.value().distributionMethod != linalg::DistributionMethod::None) {
updateBoundsForCyclicDistribution(
b, loc, it.value().procId, it.value().nprocs, lbsStorage[it.index()],