[all-commits] [llvm/llvm-project] c8e15a: [mlir][MemRefToLLVM] Remove the code for lowering ...

qcolombet via All-commits all-commits at lists.llvm.org
Fri Dec 2 02:38:06 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c8e15afa4caf74f0d8281ca3e44674f1f6c1bc52
      https://github.com/llvm/llvm-project/commit/c8e15afa4caf74f0d8281ca3e44674f1f6c1bc52
  Author: Quentin Colombet <quentin.colombet at gmail.com>
  Date:   2022-12-02 (Fri, 02 Dec 2022)

  Changed paths:
    M mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
    A mlir/test/Conversion/MemRefToLLVM/expand-then-convert-to-llvm.mlir
    M mlir/test/Conversion/MemRefToLLVM/memref-to-llvm.mlir

  Log Message:
  -----------
  [mlir][MemRefToLLVM] Remove the code for lowering subview

Subviews are supposed to be expanded before we hit the lowering
code.
The expansion is done with the pass called
expand-strided-metadata.

Add a test that demonstrate how these passes can be linked up to achieve
the desired lowering.

This patch is NFC in spirit but not in practice because `subview` gets
lowered into `reinterpret_cast(extract_strided_metadata, <some math>)`
which lowers in two memref descriptors (one for `reinterpert_cast` and
one for `extract_strided_metadata`), which creates some noise of the
form: `extractvalue(unrealized_cast(extractvalue[0]))[0]` that is
currently not simplified within MLIR but that is really just noop in
that case.

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




More information about the All-commits mailing list