[Mlir-commits] [mlir] [mlir][vector] Use inferRankReducedResultType for subview type inference. (PR #84395)
Benjamin Maxwell
llvmlistbot at llvm.org
Fri Mar 8 08:36:30 PST 2024
================
@@ -1337,8 +1301,10 @@ class DropInnerMostUnitDimsTransferRead
rewriter.getIndexAttr(0));
SmallVector<OpFoldResult> strides(srcType.getRank(),
rewriter.getIndexAttr(1));
- MemRefType resultMemrefType =
- getMemRefTypeWithDroppingInnerDims(rewriter, srcType, dimsToDrop);
+ auto resultMemrefType =
+ cast<MemRefType>(memref::SubViewOp::inferRankReducedResultType(
+ srcType.getShape().drop_back(dimsToDrop), srcType, offsets, sizes,
----------------
MacDue wrote:
The `SubVewOp` already has builders that don't take the result type (and will infer it), so I think computing the result type can be omitted in both these rewrites.
https://github.com/llvm/llvm-project/pull/84395
More information about the Mlir-commits
mailing list