1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
llvm-mirror/examples
Stefan Gränitz a7a66b3792 Add ThinLtoJIT example
Summary:
Prototype of a JIT compiler that utilizes ThinLTO summaries to compile modules ahead of time. This is an implementation of the concept I presented in my "ThinLTO Summaries in JIT Compilation" talk at the 2018 Developers' Meeting: http://llvm.org/devmtg/2018-10/talk-abstracts.html#lt8

Upfront the JIT first populates the *combined ThinLTO module index*, which provides fast access to the global call-graph and module paths by function. Next, it loads the main function's module and compiles it. All functions in the module will be emitted with prolog instructions that *fire a discovery flag* once execution reaches them. In parallel, the *discovery thread* is busy-watching the existing flags. Once it detects one has fired, it uses the module index to find all functions that are reachable from it within a given number of calls and submits their defining modules to the compilation pipeline.

While execution continues, more flags are fired and further modules added. Ideally the JIT can be tuned in a way, so that in the majority of cases the code on the execution path can be compiled ahead of time. In cases where it doesn't work, the JIT has a *definition generator* in place that loads modules if missing functions are reached.

Reviewers: lhames, dblaikie, jfb, tejohnson, pree-jackie, AlexDenisov, kavon

Subscribers: mgorny, mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, arphaman, jfb, merge_guards_bot, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72486
2020-02-01 20:25:09 +01:00
..
BrainF Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
Bye Fix several issues with compiler extensions 2020-01-10 10:10:20 +01:00
ExceptionDemo [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Fibonacci [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
HowToUseJIT [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
HowToUseLLJIT [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
IRTransforms Re-apply "[Examples] Add IRTransformations directory to examples." 2020-01-04 15:47:23 +00:00
Kaleidoscope Fix conversions in clang and examples 2020-01-29 02:48:15 +01:00
LLJITExamples [examples] Fix CMakefiles for JITLink and OrcError library refactoring 2020-01-27 13:58:50 -08:00
ModuleMaker
OCaml-Kaleidoscope
ParallelJIT [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
SpeculativeJIT [ORC] Update examples to incorporate changes in ce2207abaf9. 2020-01-21 20:37:14 -08:00
ThinLtoJIT Add ThinLtoJIT example 2020-02-01 20:25:09 +01:00
CMakeLists.txt Add ThinLtoJIT example 2020-02-01 20:25:09 +01:00
LLVMBuild.txt