• Home
  • Raw
  • Download

Lines Matching refs:JIT

2 Building a JIT: Starting out with KaleidoscopeJIT
17 Welcome to Chapter 1 of the "Building an ORC-based JIT in LLVM" tutorial. This
18 tutorial runs through the implementation of a JIT compiler using LLVM's
25 The goal of this tutorial is to introduce you to LLVM's ORC JIT APIs, show how
27 them to build a custom JIT that is suited to your use-case.
32 introduce some of the basic concepts of the ORC JIT APIs, including the
38 - `Chapter #3 <BuildingAJIT3.html>`_: Further extend the JIT by adding a
41 - `Chapter #4 <BuildingAJIT4.html>`_: Improve the laziness of our JIT by
47 a remote process with reduced privileges using the JIT Remote APIs.
49 To provide input for our JIT we will use a lightly modified version of the
53 Finally, a word on API generations: ORC is the 3rd generation of LLVM JIT API.
54 It was preceded by MCJIT, and before that by the (now deleted) legacy JIT.
60 JIT API Basics
63 The purpose of a JIT compiler is to compile code "on-the-fly" as it is needed,
65 compiler does. To support that aim our initial, bare-bones JIT API will have
71 symbols (functions or variables) that have been added to the JIT.
78 JIT J;
84 theme. Behind this API we will refine the implementation of the JIT to add
87 representations (e.g. ASTs) to be added to the JIT.
96 input for our JIT: Each time the user enters an expression the REPL will add a
97 new IR module containing the code for that expression to the JIT. If the
99 use the lookup method of our JIT class find and execute the code for the
101 new interactions with our JIT class, but for now we will take this setup for
102 granted and focus our attention on the implementation of our JIT itself.
150 which provides context for our running JIT'd code (including the string pool,
152 ``ObjectLayer``, that can be used to add object files to our JIT (though we will
154 add LLVM Modules to our JIT (and which builds on the ObjectLayer), A DataLayout
157 building IR files for the JIT.
163 a function object that will build a JIT memory manager for each module that is
164 added (a JIT memory manager manages memory allocations, memory permissions, and
165 registration of exception handlers for JIT'd code). For this we use a lambda
217 managed by the JIT (especially the LLVMContext) available to the REPL code that
231 Now we come to the first of our JIT API methods: addModule. This method is
232 responsible for adding IR to the JIT and making it available for execution. In
233 this initial implementation of our JIT we will make our modules "available for
239 enough to trigger compilation. In later chapters we will teach our JIT to defer
244 duration of the JIT. Once we switch to concurrent compilation in later chapters
248 function and variable definitions added to the JIT based on their symbol names.
253 to *mangle* the name of the symbol we're searching for first. The ORC JIT
255 linker would, rather than using plain IR symbol names. This allows JIT'd code
262 This brings us to the end of Chapter 1 of Building a JIT. You now have a basic
263 but fully functioning JIT stack that you can use to take LLVM IR and make it
264 executable within the context of your JIT process. In the next chapter we'll
265 look at how to extend this JIT to produce better quality code, and in the