[all-commits] [llvm/llvm-project] ae27c6: [mlir][MemRef] Use specialized index ops to fold e...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Wed May 7 11:17:39 PDT 2025


  Branch: refs/heads/users/krzysz00/linearize-delinearize-alias-ops-folder
  Home:   https://github.com/llvm/llvm-project
  Commit: ae27c6f86772179634ece0f38a8ba64430e08e1c
      https://github.com/llvm/llvm-project/commit/ae27c6f86772179634ece0f38a8ba64430e08e1c
  Author: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
  Date:   2025-05-07 (Wed, 07 May 2025)

  Changed paths:
    M mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
    M mlir/lib/Dialect/MemRef/Transforms/FoldMemRefAliasOps.cpp
    M mlir/test/Dialect/MemRef/fold-memref-alias-ops.mlir

  Log Message:
  -----------
  [mlir][MemRef] Use specialized index ops to fold expand/collapse_shape

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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list