[llvm-dev] More function signatures for LLVMRunFunction?

Evan Miller via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 15 11:48:14 PDT 2016

Hi Lang,

Thanks for the reply. Responses below.

As far as I know nobody is actively working on MCJIT any more. I've been
> working on the next generation of LLVM JIT APIs (ORC - see
> include/llvm/ExecutionEngine/Orc) for a while now, but they don't have
> functionality for running arbitrary functions yet.

Thanks for the pointer to ORC -- it looks like the runFunction there is a
copy-paste from MCJIT (minus the finalize() stuff).

Definitely. I'd be happy to see something like this in ORC, and I think
> there would be other people who would appreciate it too.

The basic approach I am using is to add a function to TargetMachine called

  virtual GenericValue runFunctionNatively(Function *F, void *FPtr,
ArrayRef<GenericValue> ArgValues);

This houses most of the duplicated code currently in runFunction, and can
then be called from either MCJIT or OrcMCJITReplacement. I then have an
override for X86TargetMachine that uses the register trick.

I'd like to see a generic implementation that can handle all architectures
> first, maybe with an specialized version for specific ABIs as an
> optimization.

I agree a generic implementation would be ideal, but I don't know how to do
a generic dynamic dispatch in C. Lacking that generic implementation, would
you be interested in seeing what I have so far?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160715/48b0f140/attachment.html>

More information about the llvm-dev mailing list