[Mlir-commits] [mlir] [MLIR][JitRunner] Correctly register symbol map (PR #90381)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue May 7 08:17:45 PDT 2024


Menooker wrote:

> What about the --shared-libs options exposed by mlir-cpu-runner?

A use case of `runtimesymbolMap` is that, we override the malloc/free function for the jit'd function with a customized allocator. And we don't want to override the malloc/free for the code in `XXX-cpu-runner` outside of JIT. Of course we can rewrite the MLIR to change calls to `malloc` into `malloc2` (or we can specify the allocator when lowering memref.alloc), but I think it may be more convenient to provide the runtime function via  `runtimesymbolMap`, especially when we need to turn on/off the override of malloc to see the performance difference.

Can this be done with `--shared-libs` to override libc functions?

Also sometimes, making a shared library for runtime may not be an available option in some downstream projects, due to some restrictions?

Will loading a shared library affect the whole process by adding the symbols to it, that are globally visible? What if users would like to provide the symbol for a MLIR module only?

I think the current API design to expose runtimesymbolMap is helpful, to let the down stream developer customize the internals of the JIT. Remind that we also have `llvmModuleBuilder` in the Jitmain.


https://github.com/llvm/llvm-project/pull/90381


More information about the Mlir-commits mailing list