Outlining in JIT LLVM

Just wanted to know is the code size reduction technique called outlining is implemented as a part of JIT LLVM (Orc JIT) or is it separately implemented as a part of code optimization. Please guide

Optimization passes (any transformation to IR except splitting Modules) is performed by the general LLVM optimizations, not by ORC itself.

LLVM (in either the general optimization libraries, or in ORC) doesn’t currently have an outlining pass, as far as I know. I know it’s something people talk about doing/wanting, but I don’t believe it’s been attempted/implemented so far.

The proposed outlining pass happens after lowering to machine instructions, as it’s easier to perform the matching there. Note; however, that it would be quite difficult to fit this into a JIT compilation flow. For latency, you typically wish to JIT as little as possible at a time (often single functions), yet for outlining to work well you must have multiple functions that contain duplication. It’s unclear how these two would compose.

David

Are you talking about Jessicas (in CC now) outlining patch? That implements a MachineModule pass, and outlines outline across an LLVM IR module.
I don't know how the LLVM JITs work and in what granularity they create modules. If you end up putting every function into an own module you probably won't see any outlining, if you JIT many functions at once coming from a single module you should get outlining across them.

- Matthias