[Mlir-commits] [mlir] Fix VectorEmulateNarrowType asserting on scalar type vs vector type. (PR #91613)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu May 9 09:08:36 PDT 2024


================
@@ -1119,8 +1119,9 @@ struct RewriteAlignedSubByteIntExt : OpRewritePattern<ConversionOpType> {
                                 PatternRewriter &rewriter) const override {
     // Verify the preconditions.
     Value srcValue = conversionOp.getIn();
-    auto srcVecType = cast<VectorType>(srcValue.getType());
-    auto dstVecType = cast<VectorType>(conversionOp.getType());
+    auto srcVecType = dyn_cast<VectorType>(srcValue.getType());
----------------
MaheshRavishankar wrote:

I am guessing this asserted cause this is not a `VectorType`. The `dyn_cast` just makes it a null value. Is that handled correctly?

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


More information about the Mlir-commits mailing list