llvm.org GIT mirror llvm / f43e7e4
[Kaleidoscope][BuildingAJIT] Add stub Chapter 5 text. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271213 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 3 years ago
1 changed file(s) with 55 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 =============================================================================
1 Building a JIT: Remote-JITing -- Process Isolation and Laziness at a Distance
2 =============================================================================
3
4 .. contents::
5 :local:
6
7 **This tutorial is under active development. It is incomplete and details may
8 change frequently.** Nonetheless we invite you to try it out as it stands, and
9 we welcome any feedback.
10
11 Chapter 5 Introduction
12 ======================
13
14 Welcome to Chapter 5 of the "Building an ORC-based JIT in LLVM" tutorial. This
15 chapter introduces the ORC RemoteJIT Client/Server APIs and shows how to use
16 them to build a JIT stack that will execute its code via a communications
17 channel with a different process. This can be a separate process on the same
18 machine, a process on a different machine, or even a process on a different
19 platform/architecture. The code builds on top of the lazy-AST-compiling JIT
20 stack from `Chapter 4 `_.
21
22 **To be done -- this is going to be a long one:**
23
24 **(1) Introduce channels, RPC, RemoteJIT Client and Server APIs**
25
26 **(2) Describe the client code in greater detail. Discuss modifications of the
27 KaleidoscopeJIT class, and the REPL itself.**
28
29 **(3) Describe the server code.**
30
31 **(4) Describe how to run the demo.**
32
33 Full Code Listing
34 =================
35
36 Here is the complete code listing for our running example that JITs lazily from
37 Kaleidoscope ASTS. To build this example, use:
38
39 .. code-block:: bash
40
41 # Compile
42 clang++ -g toy.cpp `llvm-config --cxxflags --ldflags --system-libs --libs core orc native` -O3 -o toy
43 # Run
44 ./toy
45
46 Here is the code for the modified KaleidoscopeJIT:
47
48 .. literalinclude:: ../../examples/Kaleidoscope/BuildingAJIT/Chapter5/KaleidoscopeJIT.h
49 :language: c++
50
51 And the code for the JIT server:
52
53 .. literalinclude:: ../../examples/Kaleidoscope/BuildingAJIT/Chapter5/Server/server.cpp
54 :language: c++