tedwoodward wrote: BTW, if you call SetCanInterpretFunctionCalls(true); somewhere, you can use the IR interpreter to call functions. PrepareTrivialCall below the implementation you do here, for JIT, handles that. https://github.com/llvm/llvm-project/pull/99336