LLVM JIT and PGO in JIT

Hi,

I haven’t touched LLVM codes for many years. I have a few questions related to LLVM JIT and PGO in JIT:

  1. Is LLVM JIT method-based or trace-based JIT?
  2. How does LLVM do gear shift from the interpreter mode to the JIT mode?
  3. Any profiling mechanism implemented in LLVM JIT?
  4. Any profile-guided optimization implemented in LLVM JIT?

thanks
Qiong

Hi,

I haven't touched LLVM codes for many years. I have a few questions related to LLVM JIT and PGO in JIT:
1) Is LLVM JIT method-based or trace-based JIT?

It could be used to implement either. Method-based is the most natural usage though.

2) How does LLVM do gear shift from the interpreter mode to the JIT mode?

It doesn't. LLVM provides the framework for building the JIT; you have to provide the runtime, interpreter, and compilation policy.

3) Any profiling mechanism implemented in LLVM JIT?

There's some limited support for instrumentation passes, but I don't believe it's particularly solid. I haven't looked at this area in any detail though.

4) Any profile-guided optimization implemented in LLVM JIT?

Yes. At the moment, they're fairly limited, but there's a fair amount of work happening in this area over the last few months. Contributions welcome.

Philip