[all-commits] [llvm/llvm-project] 63a253: [mlir][MemRef] Simplify extract_strided_metadata(s...

qcolombet via All-commits all-commits at lists.llvm.org
Thu Sep 8 10:16:53 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 63a2536f77a4037902be517399cb16b39fb732e7
      https://github.com/llvm/llvm-project/commit/63a2536f77a4037902be517399cb16b39fb732e7
  Author: Quentin Colombet <quentin.colombet at gmail.com>
  Date:   2022-09-08 (Thu, 08 Sep 2022)

  Changed paths:
    M mlir/include/mlir/Dialect/MemRef/Transforms/Passes.h
    M mlir/include/mlir/Dialect/MemRef/Transforms/Passes.td
    M mlir/include/mlir/IR/AffineExpr.h
    M mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp
    A mlir/test/Dialect/MemRef/simplify-extract-strided-metadata.mlir

  Log Message:
  -----------
  [mlir][MemRef] Simplify extract_strided_metadata(subview)

Add a dedicated pass to simplify
extract_strided_metadata(other_op(memref)).

Currently the pass features only one pattern:
extract_strided_metadata(subview).
The goal is to get rid of the subview while materializing its effects on
the offset, sizes, and strides with respect to the base object.

In other words, this simplification replaces:
```
baseBuffer, offset, sizes, strides =
    extract_strided_metadata(
        subview(memref, subOffset, subSizes, subStrides))
```

With

```
baseBuffer, baseOffset, baseSizes, baseStrides =
    extract_strided_metadata(memref)
strides#i = baseStrides#i * subSizes#i
offset = baseOffset + sum(subOffset#i * strides#i)
sizes = subSizes
```

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




More information about the All-commits mailing list