Skip to content

Commit 2083e97

Browse files
authored
Fix VectorEmulateNarrowType asserting on scalar type vs vector type. (llvm#91613)
1 parent 6c83565 commit 2083e97

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,8 +1119,9 @@ struct RewriteAlignedSubByteIntExt : OpRewritePattern<ConversionOpType> {
11191119
PatternRewriter &rewriter) const override {
11201120
// Verify the preconditions.
11211121
Value srcValue = conversionOp.getIn();
1122-
auto srcVecType = cast<VectorType>(srcValue.getType());
1123-
auto dstVecType = cast<VectorType>(conversionOp.getType());
1122+
auto srcVecType = dyn_cast<VectorType>(srcValue.getType());
1123+
auto dstVecType = dyn_cast<VectorType>(conversionOp.getType());
1124+
11241125
if (failed(
11251126
commonConversionPrecondition(rewriter, dstVecType, conversionOp)))
11261127
return failure();

0 commit comments

Comments
 (0)