[all-commits] [llvm/llvm-project] 9d2599: [mlir][MemRef] Simplify extract_strided_metadata(a...
qcolombet via All-commits
all-commits at lists.llvm.org
Mon Sep 26 09:26:27 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9d259916e1ae69f83762b1801bfb0db1faf20262
https://github.com/llvm/llvm-project/commit/9d259916e1ae69f83762b1801bfb0db1faf20262
Author: Quentin Colombet <quentin.colombet at gmail.com>
Date: 2022-09-26 (Mon, 26 Sep 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] Simplify extract_strided_metadata(allocLikeOp)
Teach the pass that simplifies extract_strided_metadata(other_op(memref))
how to get rid of extract_strided_metadata when they are fed by
allocLikeOp.
For the simplification to happen the allocLikeOp needs to have been
normalized. I.e., no weird offset and strides.
When this is the case, we replace:
```
base, offset, sizes, strides =
extract_strided_metadata(allocLikeOp(allocSizes))
```
With
```
base = reinterpret_cast allocLikeOp(allocSizes) to a flat memref<eltTy>
offset = 0
sizes = allocSizes
strides#i = prod(allocSizes#j, for j in {i+1..rank-1})
```
The computation involving dynamic sizes are expanded in affine.apply.
Differential Revision: https://reviews.llvm.org/D134577
More information about the All-commits
mailing list