[Mlir-commits] [mlir] [mlir][EmitC] Expand the MemRefToEmitC pass - Lowering `extract_strided_metadata` (PR #152208)
Marius Brehler
llvmlistbot at llvm.org
Fri Aug 15 02:33:53 PDT 2025
marbre wrote:
> I'm not entirely sure EmitC is ready for this op yet:
>
> The dialect currently supports only identity-stride layouts that map into multi-dimensional C arrays, so strides equal sizes and offset is always zero. Sizes can be made accessible by lowering the [`memref.dim`](https://mlir.llvm.org/docs/Dialects/MemRef/#memrefdim-memrefdimop) op. For the aligned pointer (currently the only pointer EmitC supports) there's the [`memref.extract_aligned_pointer_as_index`](https://mlir.llvm.org/docs/Dialects/MemRef/#memrefextract_aligned_pointer_as_index-memrefextractalignedpointerasindexop) op that could be relevant.
>
> The `extract_strided_metadata` op is for more general memrefs, which map to two pointers (base and aligned), an offset, sizes and strides, which the LLVM dialect represents using an LLVM struct. I definitely hope EmitC would one day support such memrefs, e.g. in favor of `memref.subview`, but we're not really there yet.
>
> WDYT @mgehre, @marbre, , @simon-camp?
I wasn't too much involved in the MemrefToEmitC conversion thus I am fine with whatever preference @mgehre, @aniragil and @simon-camp have. That said I can follow the concerns that this is rather quite high level and might be to early to merge it into EmitC for now.
https://github.com/llvm/llvm-project/pull/152208
More information about the Mlir-commits
mailing list