[LLVMdev] GSoC 2011: Fast JIT Code Generation for x86-64

Óscar Fuentes
2011-04-02T05:09:04Z

Viktor Pavlu <vpavlu at gmail.com> writes:

[snip]

> While the LLVM-JIT is very popular as a first try at jitting
> programming languages, projects have abandoned the LLVM-JIT when
> disappointed with the overall runtime.

Hear, hear.

> The problem is, that the benefit of faster execution is traded for
> longer compile time -- which only pays off for code that is executed
> frequently. One solution to this problem is an adaptive compilation
> scheme with separate compile strategies for cold and hot code.

[snip]

> I currently work on generating fast cycle-accurate simulators[2]. For
> this, our institute has implemented a two-part adaptive compilation
> scheme using the LLVM-JIT. Although most optimizations are turned off
> already and the FastISel instruction selector is used, the "fast"
path
> for first-time code generation is still the bottleneck of the
> simulators. This is for the largest part due to the SelectionDAG
> instruction selection process, hence the motivation for a simpler,
> two-pass code generator.

Well, anything that makes the JIT usable for those of us compiling
medium-sized code (on the order of hundred of KB to a few MB of
generated native code) is greatly appreciated.

As a means of improving runtime performance, my compiler supports the
LLVM JIT and a dumb X86 assembler generator that makes very simple
optimizations and has some hard constraints. The latter runs on a
fraction of the time and performs very similar or better than the LLVM
JIT (without LLVM's optimization passes.) So I'm pretty sure that it is
possible to dramatically reduce the time required by the JIT without a
severe impact on performance.

[snip]