[Mlir-commits] [mlir] 1ac60ce - [MLIR] Apply clang-tidy fixes for performance-unnecessary-copy-initialization in ShardingInterfaceImpl.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Mon Mar 30 04:48:53 PDT 2026


Author: Mehdi Amini
Date: 2026-03-30T04:44:53-07:00
New Revision: 1ac60ce8a0ca890b3c69489e5ffab64344e05972

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

LOG: [MLIR] Apply clang-tidy fixes for performance-unnecessary-copy-initialization in ShardingInterfaceImpl.cpp (NFC)

Added: 
    

Modified: 
    mlir/lib/Dialect/Arith/Transforms/ShardingInterfaceImpl.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Arith/Transforms/ShardingInterfaceImpl.cpp b/mlir/lib/Dialect/Arith/Transforms/ShardingInterfaceImpl.cpp
index cbfb157915c38..8b6d4c7fdd1c7 100644
--- a/mlir/lib/Dialect/Arith/Transforms/ShardingInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/Arith/Transforms/ShardingInterfaceImpl.cpp
@@ -52,7 +52,7 @@ struct ConstantShardingInterface
                     ArrayRef<Sharding> resultShardings) const {
     assert(resultShardings.size() == 1 &&
            "Expecting exactly one result sharding for arith.constant");
-    auto resultSharding = resultShardings[0];
+    const auto &resultSharding = resultShardings[0];
     if (!resultSharding) {
       return failure();
     }
@@ -78,7 +78,7 @@ struct ConstantShardingInterface
         // Currently non-splat constants are not supported.
         return failure();
       }
-      auto sharding = resultShardings[0];
+      const auto &sharding = resultShardings[0];
       auto newType = cast<RankedTensorType>(shardType(
           cOp.getType(), getGrid(op, sharding.getGridAttr(), symbolTable),
           sharding));


        


More information about the Mlir-commits mailing list