To add a transformation that simplifies memory access patterns, this PR adds a memref linearizer which is based on the GPU/DecomposeMemRefs pass, with the following changes: * support vector dialect ops * instead of decompose memrefs to rank-0 memrefs, flatten higher-ranked memrefs to rank-1. Notes: * After the linearization, a MemRef's offset is kept, so a `memref<4x8xf32, strided<[8, 1], offset: 100>>` becomes `memref<32xf32, strided<[1], offset: 100>>`. * It also works with dynamic shapes and strides and offsets (see test cases for details). * The shape of the casted memref is computed as 1d, flattened.
11 KiB
11 KiB