[all-commits] [llvm/llvm-project] 0a8d1e: [mlir][MemRef] Add pattern to resolve strided meta...

MaheshRavishankar via All-commits all-commits at lists.llvm.org
Mon Apr 3 10:48:11 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0a8d1ee739175b2039fc1656c88681d1a4326a0f
      https://github.com/llvm/llvm-project/commit/0a8d1ee739175b2039fc1656c88681d1a4326a0f
  Author: Mahesh Ravishankar <ravishankarm at google.com>
  Date:   2023-04-03 (Mon, 03 Apr 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/MemRef/Transforms/Transforms.h
    M mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
    M mlir/lib/Dialect/MemRef/Transforms/ExpandStridedMetadata.cpp
    M mlir/test/Dialect/MemRef/expand-strided-metadata.mlir

  Log Message:
  -----------
  [mlir][MemRef] Add pattern to resolve strided metadata of `memref.get_global` operation.

This changes adds patterns to resolve the base pointer, offset, sizes
and strides of the result of a `memref.get_global` operation. Since
the operation can only result in static shaped memrefs, current
resolution kicks in only for non-zero offsets, and identity strides.

Also

- Add a separate `populateResolveExtractStridedMetadata` method that
  adds just the pattern to resolve `<memref op>` ->
  `memref.extract_strided_metadata` operations.
- Refactor the `SubviewFolder` pattern to allow resolving
  `memref.subview` -> `memref.extract_strided_metadata`.

This allows using these patterns for cases where there are already
existing `memref.extract_strided_metadata` operations.

Reviewed By: qcolombet

Differential Revision: https://reviews.llvm.org/D147393




More information about the All-commits mailing list