[PATCH] Big update to Kaleidoscope tutorials.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 14:01:42 PDT 2015


Hi All,

As some of you have noticed, Kaleidoscope has had some issues since we
removed the legacy JIT last year. The tutorial code had been relying on the
behavior of the legacy JIT, and the switch to MCJIT caused many simple
use-cases to break (e.g. repeat calls to functions). Kaleidoscope Chapter
4, which introduces JIT support, had been largely fixed by taking some of
the code from Andy Kaylor's Kaleidoscope/MCJIT tutorials, but this added a
lot of engineering detail to what was supposed to be a beginner's tutorial.
The later chapters were never updated.

The attached patch fixes this situation by updating all of the Kaleidoscope
tutorials to use a new, custom, ORC-based JIT: KaleidoscopeJIT. By using
this instead of MCJIT, all of the original Kaleidoscope functionality is
restored, and we actually do a better job of behaving like a REPL (for
example, functions can be redefined). Assuming this patch is accepted, in
the near future I hope to add one or two new chapters to Kaleidoscope that
involve modifying the KaleidoscopeJIT to support lazy compilation (This
will mostly involve merging code from the Kaleidoscope/Orc tutorials).

Most of this patch is concerned with the switch to KaleidoscopeJIT and
corresponding updates to the documentation. In particular, Chapter 4 has
been substantially updated. There is also a little bit of C++11
modernization and general cleanup.

All comments welcome. If anyone would like to road-test the new tutorials
I'd be particularly interested to hear feedback on that.

Cheers,
Lang.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150825/8bf2a593/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kaleidoscope-update.patch
Type: application/octet-stream
Size: 159116 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150825/8bf2a593/attachment.obj>


More information about the llvm-commits mailing list