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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu May 9 09:42:49 PDT 2024


Author: Benoit Jacob
Date: 2024-05-09T12:42:45-04:00
New Revision: 2083e97e88ed13d39d9190d65696ad3866c23caa

URL: https://github.com/llvm/llvm-project/commit/2083e97e88ed13d39d9190d65696ad3866c23caa
DIFF: https://github.com/llvm/llvm-project/commit/2083e97e88ed13d39d9190d65696ad3866c23caa.diff

LOG: Fix VectorEmulateNarrowType asserting on scalar type vs vector type. (#91613)

Added: 
    

Modified: 
    mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp
index a301b919dc523..6025c4ad7c145 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp
@@ -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());
+    auto dstVecType = dyn_cast<VectorType>(conversionOp.getType());
+
     if (failed(
             commonConversionPrecondition(rewriter, dstVecType, conversionOp)))
       return failure();


        


More information about the Mlir-commits mailing list