forked from OSchip/llvm-project
[mlir][vector] Use dyn_cast instead of cast in patterns
This avoids crashes when the pattern is applied to ops with tensor semantics. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D113415
This commit is contained in:
parent
fd9b099906
commit
56ada0f80d
|
@ -3579,7 +3579,7 @@ class DropInnerMostUnitDims : public OpRewritePattern<vector::TransferReadOp> {
|
|||
|
||||
LogicalResult matchAndRewrite(vector::TransferReadOp readOp,
|
||||
PatternRewriter &rewriter) const override {
|
||||
auto srcType = readOp.source().getType().cast<MemRefType>();
|
||||
auto srcType = readOp.source().getType().dyn_cast<MemRefType>();
|
||||
if (!srcType || !srcType.hasStaticShape())
|
||||
return failure();
|
||||
|
||||
|
|
Loading…
Reference in New Issue