Online opt style code pass / profiling possible in LLVM JIT?


I am not sure if it is possible to do something similar to what the
LLVM pass framework offers (via the opt program) but in the JIT
instead (when running lli).

Is it possible to do any kind of online profiling (or optimization) of
dynamically compiler code similar to writing an opt style code pass
module? Or would I have to change a lot of stuff in the JIT?



Sure, you can use all of LLVM's optimizations in lli via -O.
Alternatively you can create the JIT yourself and adjust the list of
optimization passes by hand. Online profiling and feedback directed
optimization are not implemented.