[Mlir-commits] [mlir] 94d3df2 - [mlir][Tensor] Apply ClangTidy performance finding (NFC)

Adrian Kuegel llvmlistbot at llvm.org
Mon Dec 5 02:22:53 PST 2022


Author: Adrian Kuegel
Date: 2022-12-05T11:22:20+01:00
New Revision: 94d3df2015e2cec8a2d0c8e49c33bc545a9b4fc6

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

LOG: [mlir][Tensor] Apply ClangTidy performance finding (NFC)

Added: 
    

Modified: 
    mlir/lib/Dialect/Tensor/IR/TensorOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp b/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
index 9841165668a9a..4e95243c20ed2 100644
--- a/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
+++ b/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
@@ -3330,7 +3330,7 @@ ShapedType PackOp::inferPackedType(ShapedType sourceType,
                                    ArrayRef<int64_t> innerDimsPos,
                                    ArrayRef<int64_t> outerDimsPerm) {
   SmallVector<int64_t> resultShape = llvm::to_vector(sourceType.getShape());
-  for (auto tiledDim : llvm::enumerate(innerDimsPos)) {
+  for (const auto &tiledDim : llvm::enumerate(innerDimsPos)) {
     if (ShapedType::isDynamic(resultShape[tiledDim.value()]))
       continue;
     if (ShapedType::isDynamic(innerTileSizes[tiledDim.index()])) {


        


More information about the Mlir-commits mailing list