[LLVMdev] LLVM Execution engine: Native call vs LLVM IR function call

Óscar Fuentes ofv at wanadoo.es
Thu Mar 28 11:42:42 PDT 2013


nlamee at cs.mcgill.ca writes:

> Thank you for your response. I did not explicitly optimize the IR.
>
> I compile and run the two versions with
>
> ...
> GenericValue gv = EE->runFunction(bsqr, args);
> ...
> GenericValue gv2 = EE->runFunction(cppnat, args);
>
> I am calling method runFunction of ExecutionEngine. I am using the default
> code gen optimization level.

LLVM does not optimize your IR unless you explicitly ask for it. For
your example, once optimized, the code that is all LLVM will run faster
than the other version that calls a non-LLVM function.



More information about the llvm-dev mailing list