[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?

Olivier Meurant meurant.olivier at gmail.com
Thu Mar 18 07:35:57 PDT 2010


Hi Gabi,

I have no idea why your performances is not as expected with such low level
of informations.

But, I know that the binary code is cached by the JIT. You can find the code
in JIT.cpp to convince yourself :
runFunction -> getPointerToFunction ->getPointerToGlobalIfAvailable which
returns the native address of the jitted function.

You can even try to measure time needed by each runFunction to run to
double-convince yourself. :)

Olivier.


On Thu, Mar 18, 2010 at 9:21 AM, Gabi <bugspynet at gmail.com> wrote:

> Hello
> I have the following scenario, and I am not sure why the performance
> is so bad (take 30 minutes to complete with very simple generated
> functions):
>
> 1. Create module
> 2. Do something like EE =
> EngineBuilder(theModule).setEngineKind(EngineKind::JIT).create();
> 3. Create a function in the module: theModule->getOrInsertFunction(..)
> 4. Execute 1000 times the function using  EE->runFunction(function,
> args) with different args in each round.
>
> My question - Does section 4 above makes the EE recompile the function
> 1000 times?  If no, why is the performance is so bad? what am I doing
> wrong ? Maybe I should somehow cache the function's binary code?
>
>
> llvm-version 2.7
> OS: Linux 2.6.31 64 bits (intel dual core, 4GB memory)
>
> --
> Regards,
> Gabi
>
> http://bugspy.net
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100318/b517bd99/attachment.html>


More information about the llvm-dev mailing list