From 42c9b59c2be0d7db32d04f581396d3d34e143bc8 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 26 May 2016 21:17:06 +0000 Subject: [Kaleidoscope][BuildingAJIT] Add docs for Chapter 3 of the Building A JIT tutorial. llvm-svn: 270917 --- llvm/docs/tutorial/BuildingAJIT3.rst | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 llvm/docs/tutorial/BuildingAJIT3.rst (limited to 'llvm/docs/tutorial') diff --git a/llvm/docs/tutorial/BuildingAJIT3.rst b/llvm/docs/tutorial/BuildingAJIT3.rst new file mode 100644 index 00000000000..e2f71bdc200 --- /dev/null +++ b/llvm/docs/tutorial/BuildingAJIT3.rst @@ -0,0 +1,47 @@ +============================================= +Building a JIT: Per-function Lazy Compilation +============================================= + +.. contents:: + :local: + +**This tutorial is under active development. It is incomplete and details may +change frequently.** Nonetheless we invite you to try it out as it stands, and +we welcome any feedback. + +Chapter 3 Introduction +====================== + +Welcome to Chapter 3 of the "Building an ORC-based JIT in LLVM" tutorial. This +chapter discusses lazy JITing and shows you how to enable it by adding an ORC +CompileOnDemand layer the JIT from `Chapter 2 `_. + +**To be done:** + +**(1) Describe lazy function-at-a-time JITing and how it differs from the kind +of eager module-at-a-time JITing that we've been doing so far. ** + +**(2) Discuss CompileCallbackManagers and IndirectStubManagers.** + +**(3) Describe CompileOnDemandLayer (automates these components and builds stubs +and lazy compilation callbacks for IR) and how to add it to the JIT. ** + +Full Code Listing +================= + +Here is the complete code listing for our running example with a CompileOnDemand +layer added to enable lazy function-at-a-time compilation. To build this example, use: + +.. code-block:: bash + + # Compile + clang++ -g toy.cpp `llvm-config --cxxflags --ldflags --system-libs --libs core orc native` -O3 -o toy + # Run + ./toy + +Here is the code: + +.. literalinclude:: ../../examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h + :language: c++ + +`Next: Extreme Laziness -- Using Compile Callbacks to JIT directly from ASTs `_ -- cgit v1.2.3