[LLVMdev] Heuristic for choosing between MCJIT and Interpreter

Renato Golin renato.golin at linaro.org
Sun Aug 10 05:06:17 PDT 2014


On 9 August 2014 21:33, Josh Klontz <josh.klontz at gmail.com> wrote:
> I'm facing a situation where I have generated IR that only needs to be
> executed once. I've noticed for simple IR it's faster to run the interpreter
> on it, but for complex IR it's much better to JIT compile and execute it.
> I'm seeking suggestions for a good heuristic to decide which approach to
> take for any given IR. I'm leaning in favor of deciding based on the
> presence/absence of loops.

Hi Josh,

In the past, when facing a similar situation, I've decided based on
maintenance, not IR heuristics. Maybe maintaining two versions and
making sure they both get updated when you change something would be
worse than having MCJIT as a default and then try to improve the JIT
to make it fast and reliable, rather than avoid the issues altogether
and mud things up in the future.

cheers,
--renato



More information about the llvm-dev mailing list