Hello everyone,<div><br></div><div>I need some advises about (re)using ExecutionEngine with MCJIT as a driver. I'm developing a service that receives a piece of high-level code, compiles it into LLVM IR function "main" and uses MCJIT to execute the function.</div><div><br></div><div>It can happen that the same piece of code is sent to the service many times. I would like to cache the results (keep generated machine code alive) and do just the execution step. But I'm having problems with that.</div><div><br></div><div>My first attempt was to cache ExecutionEngine instance and function address (from getFunctionAddress() method). Executing cached function second time crashes the process.</div><div><br></div><div>I noticed that doing getFunctionAddress() each time helps a bit. There is no crash but results produced by executed function are incorrect and there are probably some memory access violations going on.</div><div><br></div><div>Using the same function name for each code is probably a bad idea in case of MCJIT, so I changed the names to some random value. However, it did not help in any of previous problems.</div><div><br></div><div>I thinking about using single instance of ExecutionEngine or share Memory Manager. Can I get any advice on that?</div><div><br></div><div>Happy New Year,</div><div>PaweÅ‚ Bylica</div><div><br></div><div><br></div>