[Mlir-commits] [mlir] add7bf1 - Apply clang-tidy fixes for performance-unnecessary-copy-initialization in CodegenUtils.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Wed Oct 12 09:23:33 PDT 2022


Author: Mehdi Amini
Date: 2022-10-12T16:22:43Z
New Revision: add7bf150cc85e3795c0bdcb8f0af8f193b92ef2

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

LOG: Apply clang-tidy fixes for performance-unnecessary-copy-initialization in CodegenUtils.cpp (NFC)

Added: 
    

Modified: 
    mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp
index aaeb6255bf461..d2a07d448abed 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp
@@ -471,7 +471,7 @@ void mlir::sparse_tensor::genReshapeDstShape(
   unsigned start = 0;
   // Expand the i-th dimension in srcShape.
   for (unsigned i = 0, size = srcShape.size(); i < size; i++) {
-    auto map = reassociation[i];
+    const auto &map = reassociation[i];
     auto srcDim = srcShape[i];
     // Iterate through dimensions expanded from the i-th dimension.
     for (unsigned j = start; j < start + map.size(); j++) {


        


More information about the Mlir-commits mailing list