[all-commits] [llvm/llvm-project] 54cda2: [mlir][MemRef] Add patterns to extract address com...

qcolombet via All-commits all-commits at lists.llvm.org
Tue Mar 28 05:04:37 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 54cda2ec976a89fcf5157d78479a576b09922df7
  Author: Quentin Colombet <quentin.colombet at gmail.com>
  Date:   2023-03-28 (Tue, 28 Mar 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/MemRef/TransformOps/MemRefTransformOps.td
    A mlir/include/mlir/Dialect/MemRef/Transforms/Transforms.h
    M mlir/lib/Dialect/MemRef/TransformOps/CMakeLists.txt
    M mlir/lib/Dialect/MemRef/TransformOps/MemRefTransformOps.cpp
    M mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/MemRef/Transforms/ExtractAddressComputations.cpp
    A mlir/test/Dialect/MemRef/extract-address-computations.mlir
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

  Log Message:
  [mlir][MemRef] Add patterns to extract address computations

This patch adds patterns to rewrite memory accesses such that the resulting
accesses are only using a base pointer.
memref.load %base[%off0, ...]

Will be rewritten in:
%new_base = memref.subview %base[%off0,...][1,...][1,...]
memref.load %new_base[%c0,...]

The idea behind these patterns is to offer a way to more gradually lower
address computations.

These patterns are the exact opposite of FoldMemRefAliasOps.
I've implemented the support of only five operations in this patch:
- memref.load
- memref.store
- nvgpu.ldmatrix
- vector.transfer_read
- vector.transfer_write

Going forward we may want to provide an interface for these rewritings (and
the ones in FoldMemRefAliasOps.)
One step at a time!

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

More information about the All-commits mailing list