[Mlir-commits] [mlir] [mlir][linalg] Fix vectorizer generating invalid vector.gather for 0-D tensor.extract (PR #187085)

Andrzej WarzyƄski llvmlistbot at llvm.org
Wed Mar 18 06:59:25 PDT 2026


================
@@ -1254,19 +1259,20 @@ vectorizeTensorExtract(RewriterBase &rewriter, VectorizationState &state,
         rewriter, loc, resultType, extractOp.getTensor(), transferReadIdxs,
         /*padding=*/std::nullopt, 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};
-    auto readMaskType = VectorType::get(readMaskShape, rewriter.getI1Type());
-    auto allTrue = vector::ConstantMaskOp::create(
-        rewriter, loc, readMaskType, vector::ConstantMaskKind::AllTrue);
-    auto *maskedReadOp =
-        mlir::vector::maskOperation(rewriter, transferReadOp, allTrue);
+    Operation *resultOp = transferReadOp;
----------------
banach-space wrote:

[nit]
```suggestion
    Operation *readOrMaskedReadOp = transferReadOp;
```

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


More information about the Mlir-commits mailing list