[PATCH] D133625: [mlir][MemRef] Simplify extract_strided_metadata(expand_shape)

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 13:35:13 PDT 2022


qcolombet marked 2 inline comments as done.
qcolombet added inline comments.


================
Comment at: mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp:177
+static SmallVector<OpFoldResult>
+getExpandedSizes(memref::ExpandShapeOp expandShape, OpBuilder &builder,
+                 const SmallVectorImpl<OpFoldResult> &origSizes,
----------------
qcolombet wrote:
> nicolasvasilache wrote:
> > I would make this a first-class citizen of expand: `SmallVector<OpFoldResult> memref::ExpandShapeOp::buildExpandedSizes(...)`.
> > 
> > Then as the op semantics evolve to take the result shape operands, we can update this.
> That's not possible because the MemRef dialect would depend on Affine dialect if we were to do that.
For the record, my plan was to move that into a common place (e.g., `ReshapeOpsUtils`), when we think it looks good.


================
Comment at: mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp:178
+getExpandedSizes(memref::ExpandShapeOp expandShape, OpBuilder &builder,
+                 const SmallVectorImpl<OpFoldResult> &origSizes,
+                 unsigned groupId) {
----------------
nicolasvasilache wrote:
> ArrayRef ?
Good point!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133625/new/

https://reviews.llvm.org/D133625



More information about the llvm-commits mailing list