[all-commits] [llvm/llvm-project] d66544: [mlir][MemRef] Change the anchor point of a reshap...

qcolombet via All-commits all-commits at lists.llvm.org
Mon Nov 14 11:06:12 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d665448a7f3ad88fac6c852703cf1f7baeb9200b
      https://github.com/llvm/llvm-project/commit/d665448a7f3ad88fac6c852703cf1f7baeb9200b
  Author: Quentin Colombet <quentin.colombet at gmail.com>
  Date:   2022-11-14 (Mon, 14 Nov 2022)

  Changed paths:
    M mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp
    M mlir/test/Dialect/MemRef/simplify-extract-strided-metadata.mlir

  Log Message:
  -----------
  [mlir][MemRef] Change the anchor point of a reshapeLikeOp pattern

Essentially, this patches changes the anchor point of the
`extract_strided_metadata(reshapeLikeOp)` pattern from
`extract_strided_metadata` to `reshapeLikeOp`.

In details, this means that instead of replacing:
```
base, offset, sizes, strides =
  extract_strided_metadata(reshapeLikeOp(src))
```
With
```
base, offset = extract_strided_metadata(src)
sizes = <some math>
strides = <some math>
```

We replace only the reshapeLikeOp part and connect it back with a
reinterpret_cast:
```
val = reshapeLikeOp(src)
```
=>
```
base, offset, ... = extract_strided_metadata(src)
sizes = <some math>
strides = <some math>
val = reinterpret_cast base, offset, sizes, strides

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




More information about the All-commits mailing list