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

Artem Kroviakov llvmlistbot at llvm.org
Fri Jun 7 09:17:35 PDT 2024


================
@@ -151,10 +151,12 @@ struct LinearizeVectorExtractStridedSlice final
   LogicalResult
   matchAndRewrite(vector::ExtractStridedSliceOp extractOp, OpAdaptor adaptor,
                   ConversionPatternRewriter &rewriter) const override {
-    Type dstType = getTypeConverter()->convertType(extractOp.getType());
-    assert(!(extractOp.getVector().getType().isScalable() ||
-             cast<VectorType>(dstType).isScalable()) &&
-           "scalable vectors are not supported.");
+    VectorType dstType =
+        getTypeConverter()->convertType<VectorType>(extractOp.getType());
+    assert(dstType && "vector type destination expected.");
----------------
akroviakov wrote:

MLIR doc says `vector of any type values`, shouldn't then getting types other than vector be a logical error rather than a match failure? The reasoning for `assert` here would be the same as in the [comment](https://github.com/llvm/llvm-project/pull/93590#discussion_r1617824093) above. Am I wrong?

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


More information about the Mlir-commits mailing list