[Mlir-commits] [mlir] [mlir][vector] Use notifyMatchFailure instead of assert in VectorLinearize (PR #93590)

Artem Kroviakov llvmlistbot at llvm.org
Thu Jun 13 12:52:07 PDT 2024


================
@@ -336,9 +342,10 @@ struct LinearizeVectorExtract final
   matchAndRewrite(vector::ExtractOp extractOp, OpAdaptor adaptor,
                   ConversionPatternRewriter &rewriter) const override {
     Type dstTy = getTypeConverter()->convertType(extractOp.getType());
-    assert(!(extractOp.getVector().getType().isScalable() ||
-             cast<VectorType>(dstTy).isScalable()) &&
-           "scalable vectors are not supported.");
+    if (extractOp.getVector().getType().isScalable() ||
+        cast<VectorType>(dstTy).isScalable())
----------------
akroviakov wrote:

The test case is there:
```mlir
%0 = vector.extract %arg0[1,1,1]: f32 from vector<2x8x2xf32>
```
but fixing it can get a bit tricky because right now there are a lot of vector result assumptions (e.g., `isLessThanTargetBitWidth()`, `populateVectorLinearizeShuffleLikeOpsPatterns()`)

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


More information about the Mlir-commits mailing list