[Mlir-commits] [mlir] 6157a06 - [mlir][Tosa] Apply ClangTidy performance findings (NFC)

Adrian Kuegel llvmlistbot at llvm.org
Thu Dec 22 05:13:55 PST 2022


Author: Adrian Kuegel
Date: 2022-12-22T14:13:30+01:00
New Revision: 6157a0679fb9710bb01fd10579ece0edfa98d13c

URL: https://github.com/llvm/llvm-project/commit/6157a0679fb9710bb01fd10579ece0edfa98d13c
DIFF: https://github.com/llvm/llvm-project/commit/6157a0679fb9710bb01fd10579ece0edfa98d13c.diff

LOG: [mlir][Tosa] Apply ClangTidy performance findings (NFC)

Added: 
    

Modified: 
    mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeConv2D.cpp
    mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeDepthwise.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeConv2D.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeConv2D.cpp
index 9563740f5e2ad..48a7927e4da6d 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeConv2D.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeConv2D.cpp
@@ -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();
 

diff  --git a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeDepthwise.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeDepthwise.cpp
index f26d289ff2ac9..b80dc61b9c2aa 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeDepthwise.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaDecomposeDepthwise.cpp
@@ -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();
 


        


More information about the Mlir-commits mailing list