[Mlir-commits] [mlir] b7981a7 - [mlir] Apply ClangTidyPerformance finding (NFC).

Adrian Kuegel llvmlistbot at llvm.org
Thu Aug 29 01:15:11 PDT 2024


Author: Adrian Kuegel
Date: 2024-08-29T08:14:55Z
New Revision: b7981a78f0aaea1500d79a519c0be03c69d9b1ac

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

LOG: [mlir] Apply ClangTidyPerformance finding (NFC).

Use const reference for loop variable.

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp b/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp
index d47a82b59bcada..5bf2f91c2c7bc8 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp
@@ -105,13 +105,13 @@ static ReductionKind getReductionKindOfLinalgOp(LinalgOp op) {
 static MeshOp getMesh(Operation *op, ArrayRef<MeshSharding> operandShardings,
                       ArrayRef<MeshSharding> resultShardings,
                       SymbolTableCollection &symbolTable) {
-  for (MeshSharding sharding : operandShardings) {
+  for (const MeshSharding& sharding : operandShardings) {
     if (sharding) {
       return mesh::getMesh(op, sharding.getMeshAttr(), symbolTable);
     }
   }
 
-  for (MeshSharding sharding : resultShardings) {
+  for (const MeshSharding& sharding : resultShardings) {
     if (sharding) {
       return mesh::getMesh(op, sharding.getMeshAttr(), symbolTable);
     }


        


More information about the Mlir-commits mailing list