[Mlir-commits] [mlir] [MLIR] Add a utility pass to linearize `memref` (PR #136797)
Alan Li
llvmlistbot at llvm.org
Fri May 2 06:24:38 PDT 2025
lialan wrote:
> Can you take the GPU dialect tests for the pass this was based on and switch them over to this version scheduled on a GPU module?
>
> Also, I'd like to add a test
>
> ```
> func.func @load_from_subview(%x: memref<8x8xf32>, %col: index, %row: index) -> f32 {
> %subview = memref.subview %input[0, 0] [4, 4] [1, 1] : memref<8x8xf32> to memref<4x4xf32, strided<[8, 1]>>
> %ret = memref.load %subview[%row, %col] : memref<4x4xf32, strided<[8, 1]>>
> return %ret : f32
> }
> ```
>
> to make sure that this doesn't become
>
> ```
> memref.load[(row * 8 + col)] : memref<16xf32>
> ```
Well I think it actually transforms into what you have described above, because the transformation folds `memref.subview` into the use of memref.
https://github.com/llvm/llvm-project/pull/136797
More information about the Mlir-commits
mailing list