[LLVMdev] Deep JIT specialization

Chris Lattner clattner at apple.com
Thu May 27 09:44:44 PDT 2010


On May 27, 2010, at 6:08 AM, Nicolas Capens wrote:

> Hi all,
>  
> I'm attempting to use LLVM for run-time code specialization, but I'm facing a performance hurdle. I'm currently performing the specialization during the AST to LLVM IR translation, but unfortunately this leads to relatively slow recompiles as LLVM has to perform all the heavy (optimization) passes over and over again.
>  
> So I was hoping that by first creating unspecialized LLVM IR, optimizing that as much as possible, and then performing the specializations starting from this optimized IR, the recompiles would be significantly faster. Currently the mem2reg and instcombine passes take the majority of compilation time, which could be avoided using "deep" JIT specialization.
>  
> So my question is how do I get started with this? Currently tracking the specialization parameters and caching the generated specialized functions is done outside of LLVM. So I imagine I'll have to somehow inform LLVM of the semi-constant values of the specialization parameters, without losing the original (optimized) IR. Can I add and remove specialized function instances at run-time?
>  

Hi Nicolas,

Nate Begeman's "building an efficient JIT" talk about the llvm developer meeting last year (or the year before) is a great place to start looking for this sort of thing.

-Chris





More information about the llvm-dev mailing list