diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp --- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp @@ -296,8 +296,7 @@ using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(ReshapeOpTy reshapeOp, PatternRewriter &rewriter) const override { - auto srcReshapeOp = - dyn_cast_or_null(reshapeOp.src().getDefiningOp()); + auto srcReshapeOp = reshapeOp.src().template getDefiningOp(); if (!srcReshapeOp) return failure(); @@ -340,7 +339,7 @@ // producer is same as the return type of the consumer. This can only be // verified if the shapes in question are static. ReshapeOpTy reshapeSrcOp = - dyn_cast_or_null(reshapeOp.src().getDefiningOp()); + reshapeOp.src().template getDefiningOp(); if (reshapeSrcOp && reshapeSrcOp.getSrcType().hasStaticShape() && reshapeOp.getResultType().hasStaticShape() && reshapeSrcOp.getSrcType() == reshapeOp.getResultType())