How to use memref calling convention at runtime for jitted code

I’m trying to use a variant of the “Toy” example source code to play around with jitting some code lowered from the affine and memref dialects. Based on some googling and experimenting with conversion passes, memrefs arguments to functions are expanded into all the values contained in the memref struct representation. I was unable to find documentation for what the calling convention for expanding these memrefs is. I’m also looking for an example somewhere of a function that accepts a memref being jit-ed and called with the ExecutionEngine infrastructure on an array allocated by the host program.

Have you seen LLVM IR Target - MLIR and LLVM IR Target - MLIR?

And there’s some tests here which may be good examples: llvm-project/Invoke.cpp at 0ae342f45bedd29e34690de087011a9da4db6a65 · llvm/llvm-project · GitHub

Thank you, this is exactly what I was looking for! Google searches didn’t turn up these pages.