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

Chao Chen llvmlistbot at llvm.org
Fri Jun 7 08:50:31 PDT 2024


================
@@ -264,10 +266,14 @@ struct LinearizeVectorShuffle final
   LogicalResult
   matchAndRewrite(vector::ShuffleOp shuffleOp, OpAdaptor adaptor,
                   ConversionPatternRewriter &rewriter) const override {
-    Type dstType = getTypeConverter()->convertType(shuffleOp.getType());
+    VectorType dstType =
+        getTypeConverter()->convertType<VectorType>(shuffleOp.getType());
+    assert(dstType && "vector type destination expected.");
+    // The assert is used because vector.shuffle does not support scalable
+    // vectors.
----------------
chencha3 wrote:

Same here. I am wondering if it is better to use `notifyMatchFailure` instead of `assert`

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


More information about the Mlir-commits mailing list