Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mlir
diff options
context:
space:
mode:
authorMehdi Amini <joker.eph@gmail.com>2022-05-16 12:51:26 +0300
committerMehdi Amini <joker.eph@gmail.com>2022-05-18 19:15:46 +0300
commite1ff449ec9272bf9af6a0eab5240775b9a8a09fc (patch)
tree20bd7de0e18d506e1e72f8eac98dc6b447c8446f /mlir
parentc218fd3d7d3764eb123c8429bbcd33bacfe2e633 (diff)
Apply clang-tidy fixes for performance-for-range-copy in LinalgOps.cpp (NFC)
Diffstat (limited to 'mlir')
-rw-r--r--mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
index 0acd1b931fa6..70437c6caa19 100644
--- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
+++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
@@ -919,7 +919,7 @@ struct DeduplicateAndRemoveDeadOperandsAndResults
// - it is not used in the payload, and
// - the corresponding indexing maps are not needed for loop bound
// computation.
- for (auto outputOpOperand :
+ for (const auto &outputOpOperand :
llvm::enumerate(genericOp.getOutputOperands())) {
unprocessedIndexingMaps = unprocessedIndexingMaps.drop_front();
Value result = genericOp.getResult(outputOpOperand.index());
@@ -985,7 +985,8 @@ struct DeduplicateAndRemoveDeadOperandsAndResults
SmallVector<Value> newYieldVals;
YieldOp origYieldOp = cast<YieldOp>(block->getTerminator());
rewriter.setInsertionPoint(origYieldOp);
- for (auto yieldOpOperands : llvm::enumerate(origYieldOp.values())) {
+ for (const auto &yieldOpOperands :
+ llvm::enumerate(origYieldOp.values())) {
if (!droppedOutputs.count(yieldOpOperands.index())) {
newYieldVals.push_back(yieldOpOperands.value());
continue;
@@ -997,7 +998,7 @@ struct DeduplicateAndRemoveDeadOperandsAndResults
// Replace all live uses of the op.
SmallVector<Value> replacementsVals(genericOp->getNumResults(), nullptr);
unsigned newResultNum = 0;
- for (auto result : llvm::enumerate(genericOp.getResults()))
+ for (const auto &result : llvm::enumerate(genericOp.getResults()))
if (!droppedOutputs.count(result.index()))
replacementsVals[result.index()] = newOp.getResult(newResultNum++);
rewriter.replaceOp(genericOp, replacementsVals);