diff options
author | Andrzej WarzyĆski <andrzej.warzynski@arm.com> | 2023-12-04 10:21:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 10:21:32 +0000 |
commit | 8171eac23fe7756319444c2caa27216a1e9f046a (patch) | |
tree | 452b58f00e021ebf11bc744ad8c503bf2dc15c8a /libcxx/include/__algorithm/generate.h | |
parent | f827b953ab3206294530685b8b821f1a60f3836c (diff) | |
download | llvm-8171eac23fe7756319444c2caa27216a1e9f046a.zip llvm-8171eac23fe7756319444c2caa27216a1e9f046a.tar.gz llvm-8171eac23fe7756319444c2caa27216a1e9f046a.tar.bz2 |
[mlir][Vector] Update patterns for flattening vector.xfer Ops (1/N) (#73522)
Updates "flatten vector" patterns to support more cases, namely Ops that
read/write vectors with leading unit dims. For example:
```mlir
%0 = vector.transfer_read %arg0[%c0, %c0, %c0, %c0] ... :
memref<5x4x3x2xi8, strided<[24, 6, 2, 1], offset: ?>>, vector<1x1x2x2xi8>
```
Currently, the `vector.transfer_read` above would not be flattened. With
this
change, it will be rewritten as follows:
```mlir
%collapse_shape = memref.collapse_shape %arg0 [[0, 1, 2, 3]] :
memref<5x4x3x2xi8, strided<[24, 6, 2, 1], offset: ?>>
into memref<120xi8, strided<[1], offset: ?>>
%0 = vector.transfer_read %collapse_shape[%c0] ... :
memref<120xi8, strided<[1], offset: ?>>, vector<4xi8>
%1 = vector.shape_cast %0 : vector<4xi8> to vector<1x1x2x2xi8>
```
`hasMatchingInnerContigousShape` is generalised and renamed as
`isContiguousSlice` to better match the updated functionality. A few
test names are updated to better highlight what case is being exercised.
Diffstat (limited to 'libcxx/include/__algorithm/generate.h')
0 files changed, 0 insertions, 0 deletions