[LLVMdev] In-memory compilation/execution

Alain Frisch alain.frisch at lexifi.com
Wed Aug 8 07:54:05 PDT 2007


Hello,

I now have a working installation of LLVM under Vista/Cygwin and I can 
play with it. First of all, I'd like to say that I'm impressed by the 
elegance of the APIs and the overall quality of the project.

What we'd like to do is to compile textual LLVM code in memory and 
execute it immediately. The code would take some time to run, and so 
we'd like to fully optimize it. I've started with the JIT compiler and 
it works fine. I have several questions.

1. It seems to me (correct me if I'm wrong) that the JIT does not use 
all the optimization passes. Is there a way to use the JIT and still get 
optimized code?

2. I'm not interested in lazy compilation because I know that all the 
functions will be called. Is there a way to compile all the functions 
immediately (I guess this would be slightly more efficient)?

3. The compiled code needs to call functions in the host application. 
Dynamic linking is not an option (Windows). I'm now using the 
ExecutionEngine's FindFunctionNamed and addGlobalMapping method to bind 
declared external functions in the compiled code to host functions. Is 
this the best way to do it?

Thanks!


Alain




More information about the llvm-dev mailing list