[Mlir-commits] [mlir] [mlir][linalg] Fix vectorization of tensor.extract (PR #118105)

Han-Chung Wang llvmlistbot at llvm.org
Mon Dec 2 10:49:31 PST 2024


================
@@ -1165,8 +1165,18 @@ vectorizeTensorExtract(RewriterBase &rewriter, VectorizationState &state,
         loc, resultType, extractOp.getTensor(), transferReadIdxs,
         permutationMap, inBounds);
 
+    // Mask this broadcasting xfer_read here rather than relying on the generic
+    // path (the generic path assumes identity masking map, which wouldn't be
+    // valid here).
+    SmallVector<int64_t> readMaskShape{1};
----------------
hanhanW wrote:

```suggestion
    SmallVector<int64_t> readMaskShape = {1};
```

style nit: use assignment syntax.



Both llvm style guide and abseil's totw suggest to not use brace intializer in this case, see https://abseil.io/tips/88 and https://llvm.org/docs/CodingStandards.html#do-not-use-braced-initializer-lists-to-call-a-constructor




https://github.com/llvm/llvm-project/pull/118105


More information about the Mlir-commits mailing list