llvm-project
a891163e - [mlir][MemRef] Use specialized index ops to fold expand/collapse_shape (#138930)

Commit
139 days ago
[mlir][MemRef] Use specialized index ops to fold expand/collapse_shape (#138930) This PR updates the FoldMemRefAliasOps to use `affine.linearize_index` and `affine.delinearize_index` to perform the index computations needed to fold a `memref.expand_shape` or `memref.collapse_shape` into its consumers, respectively. This also loosens some limitations of the pass: 1. The existing `output_shape` argument to `memref.expand_shape` is now used, eliminating the need to re-infer this shape or call `memref.dim`. 2. Because we're using `affine.delinearize_index`, the restriction that each group in a `memref.collapse_shape` can only have one dynamic dimension is removed.
Author
Parents
Loading