diff options
Diffstat (limited to 'mlir/lib/Dialect/MemRef/Transforms/RuntimeOpVerification.cpp')
-rw-r--r-- | mlir/lib/Dialect/MemRef/Transforms/RuntimeOpVerification.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mlir/lib/Dialect/MemRef/Transforms/RuntimeOpVerification.cpp b/mlir/lib/Dialect/MemRef/Transforms/RuntimeOpVerification.cpp index 9ffb315587e3..05a069d98ef3 100644 --- a/mlir/lib/Dialect/MemRef/Transforms/RuntimeOpVerification.cpp +++ b/mlir/lib/Dialect/MemRef/Transforms/RuntimeOpVerification.cpp @@ -38,14 +38,14 @@ struct CastOpInterface void generateRuntimeVerification(Operation *op, OpBuilder &builder, Location loc) const { auto castOp = cast<CastOp>(op); - auto srcType = castOp.getSource().getType().cast<BaseMemRefType>(); + auto srcType = cast<BaseMemRefType>(castOp.getSource().getType()); // Nothing to check if the result is an unranked memref. - auto resultType = castOp.getType().dyn_cast<MemRefType>(); + auto resultType = dyn_cast<MemRefType>(castOp.getType()); if (!resultType) return; - if (srcType.isa<UnrankedMemRefType>()) { + if (isa<UnrankedMemRefType>(srcType)) { // Check rank. Value srcRank = builder.create<RankOp>(loc, castOp.getSource()); Value resultRank = @@ -75,7 +75,7 @@ struct CastOpInterface // Check dimension sizes. for (const auto &it : llvm::enumerate(resultType.getShape())) { // Static dim size -> static/dynamic dim size does not need verification. - if (auto rankedSrcType = srcType.dyn_cast<MemRefType>()) + if (auto rankedSrcType = dyn_cast<MemRefType>(srcType)) if (!rankedSrcType.isDynamicDim(it.index())) continue; |