Commit 63a2536f authored by Quentin Colombet's avatar Quentin Colombet
Browse files

[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
parent de883be1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment