[LLVMdev] Heuristic for choosing between MCJIT and Interpreter

David Chisnall David.Chisnall at cl.cam.ac.uk
Wed Aug 13 03:15:19 PDT 2014


On 12 Aug 2014, at 21:02, Josh Klontz <josh.klontz at gmail.com> wrote:

> Thanks to everyone for the helpful feedback. I was able to incorporate the interpreter and loop heuristic with very little additional code, so I'm not immediately concerned about the extra maintenance introduced. An AST interpreter does sound sensible in the long run, but is more effort than I can justify spending at the moment. If the IR interpreter does bitrot (a shame) the MCJIT alone is probably still fast enough for my use.

Longer term, you might want to look at the Alphabet Soup project from Oracle Labs.  They apply type feedback to an AST interpreter and get very good performance out of it (>20% of compiled code - they did have JavaScript running faster than V8 for a while, but V8 is now quite a bit faster).  The ASTs that they produce as a result of the type feedback are then ideal sources for feeding into your LLVM back end.

Of course, this is without knowing anything about your source language.  If it has a strict static type system, then this approach will not be relevant.

David





More information about the llvm-dev mailing list