summaryrefslogtreecommitdiff
path: root/mlir/lib/Dialect/MemRef/Transforms/IndependenceTransforms.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Dialect/MemRef/Transforms/IndependenceTransforms.cpp')
-rw-r--r--mlir/lib/Dialect/MemRef/Transforms/IndependenceTransforms.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/mlir/lib/Dialect/MemRef/Transforms/IndependenceTransforms.cpp b/mlir/lib/Dialect/MemRef/Transforms/IndependenceTransforms.cpp
index aa1d27dc863e..68b72eff8c97 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/IndependenceTransforms.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/IndependenceTransforms.cpp
@@ -71,11 +71,9 @@ propagateSubViewOp(RewriterBase &rewriter,
UnrealizedConversionCastOp conversionOp, SubViewOp op) {
OpBuilder::InsertionGuard g(rewriter);
rewriter.setInsertionPoint(op);
- auto newResultType =
- SubViewOp::inferRankReducedResultType(
- op.getType().getShape(), op.getSourceType(), op.getMixedOffsets(),
- op.getMixedSizes(), op.getMixedStrides())
- .cast<MemRefType>();
+ auto newResultType = cast<MemRefType>(SubViewOp::inferRankReducedResultType(
+ op.getType().getShape(), op.getSourceType(), op.getMixedOffsets(),
+ op.getMixedSizes(), op.getMixedStrides()));
Value newSubview = rewriter.create<SubViewOp>(
op.getLoc(), newResultType, conversionOp.getOperand(0),
op.getMixedOffsets(), op.getMixedSizes(), op.getMixedStrides());