[mlir][Tosa] Apply ClangTidy performance findings (NFC)
authorAdrian Kuegel <akuegel@google.com>
Thu, 22 Dec 2022 13:13:30 +0000 (14:13 +0100)
committerAdrian Kuegel <akuegel@google.com>
Thu, 22 Dec 2022 13:13:30 +0000 (14:13 +0100)
mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeConv2D.cpp
mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeDepthwise.cpp

index 9563740..48a7927 100644 (file)
@@ -59,7 +59,7 @@ struct Conv2DIsFullyConnected : public OpRewritePattern<tosa::Conv2DOp> {
 
     auto padAttr = op.getPad();
     llvm::SmallVector<int64_t> pad(8, 0);
-    for (auto it : llvm::enumerate(padAttr.getValue()))
+    for (const auto &it : llvm::enumerate(padAttr.getValue()))
       pad[it.index() + 2] =
           it.value().cast<IntegerAttr>().getValue().getSExtValue();
 
index f26d289..b80dc61 100644 (file)
@@ -95,7 +95,7 @@ struct DepthwiseConv2DIsMul : public OpRewritePattern<tosa::DepthwiseConv2DOp> {
 
     auto padAttr = op.getPad();
     llvm::SmallVector<int64_t> pad(10, 0);
-    for (auto it : llvm::enumerate(padAttr.getValue()))
+    for (const auto &it : llvm::enumerate(padAttr.getValue()))
       pad[it.index() + 2] =
           it.value().cast<IntegerAttr>().getValue().getSExtValue();