summaryrefslogtreecommitdiffstats
path: root/llvm/docs/tutorial
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2016-05-26 21:17:06 +0000
committerLang Hames <lhames@gmail.com>2016-05-26 21:17:06 +0000
commit42c9b59c2be0d7db32d04f581396d3d34e143bc8 (patch)
tree35f49b6ec40bd80b441ae35735da600b820e5c52 /llvm/docs/tutorial
parent3a869dc4812c45f0ce9dd381ebe90f77e5640ede (diff)
downloadbcm5719-llvm-42c9b59c2be0d7db32d04f581396d3d34e143bc8.tar.gz
bcm5719-llvm-42c9b59c2be0d7db32d04f581396d3d34e143bc8.zip
[Kaleidoscope][BuildingAJIT] Add docs for Chapter 3 of the Building A JIT
tutorial. llvm-svn: 270917
Diffstat (limited to 'llvm/docs/tutorial')
-rw-r--r--llvm/docs/tutorial/BuildingAJIT3.rst47
1 files changed, 47 insertions, 0 deletions
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 <BuildingAJIT2.html>`_.
+
+**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 <BuildingAJIT4.html>`_
OpenPOWER on IntegriCloud