[llvm-dev] ORC - which example code?

Stefan Gränitz via llvm-dev llvm-dev at lists.llvm.org
Fri May 17 09:44:54 PDT 2019


Hey Russel

RTDyldObjectLinkingLayer is the regular one, which makes use of
RuntimeDyld under the hood. This should be the default and work with
both, OrcV1 and OrcV2.

ObjectLinkingLayer is the layer that Lang plans to use for JITLink. This
was added very recently [1] with the ultimate goal to get rid of
RuntimeDyld, which allows relaxed constraints on the used CodeModel,
better supports concurrency and overcomes hacks like [2]. It's
definitely not something you want to use in production at this point. It
lacks a number of features compared to RuntimeDlyld, i.e. backends for
all object formats except Mach-O and compatibility with JITEventListeners.

If you look for RTDyldObjectLinkingLayer examples in-tree, see how LLJIT
does it [3] and how lli uses LLLazyJIT [4].
Out-of-tree you can have a look at my example project if you like: it
shows how to build on LLJIT [5] and how to break free from it [6]. This
is much more focused than the in-tree code.

Hope it helps.
Best, Stefan

--

[1] https://reviews.llvm.org/D58704
[2]
https://github.com/llvm/llvm-project/blob/198611b0/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp#L1388
[3]
https://github.com/llvm/llvm-project/blob/777cad2c/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp#L86
[4]
https://github.com/llvm/llvm-project/blob/777cad2c/llvm/tools/lli/lli.cpp#L754
[5] https://github.com/weliveindetail/JitFromScratch/commit/a61a3a9
[6] https://github.com/weliveindetail/JitFromScratch/commit/b5bcb5e

On 5/13/19 12:15 PM, Russell Wallace via llvm-dev wrote:
> It turns out that ObjectLinkingLayer doesn't exist; that identifier
> occurs in the source tree only in comments, never as an identifier.
>
> Does that mean the second version of the API has been deleted and the
> first is now correct?
>
> On Fri, May 10, 2019 at 6:18 AM Praveen Velliengiri
> <praveenvelliengiri at gmail.com <mailto:praveenvelliengiri at gmail.com>>
> wrote:
>
>     Hi Russell
>     As far as I know, the second is preferred. You can also look at
>     the LLJIT && LLLazyJIT stack in the trunk which is off the shelf
>     utility.
>     Thanks
>
>     On Fri, 10 May 2019 at 08:20, Russell Wallace via llvm-dev
>     <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>
>         Trying to put together a simple test JIT compiler, using ORC
>         which as I understand it will be the supported API going
>         forward, I noticed that in the first chapter of the updated
>         Kaleidoscope tutorial, there is sample code that starts like
>         this:
>
>         ExecutionSession ES;
>         RTDyldObjectLinkingLayer ObjectLayer;
>         IRCompileLayer CompileLayer;
>
>         DataLayout DL;
>         MangleAndInterner Mangle;
>         ThreadSafeContext Ctx;
>
>         But
>         in https://llvm.org/devmtg/2016-11/Slides/Hames-ORC.pdf there
>         is sample code that looks like this:
>
>         ObjectLinkingLayer LinkLayer;
>         SimpleCompiler Compiler(TargetMachine());
>         IRCompileLayer<…> CompileLayer(LinkLayer, Compiler);
>
>         Related but significantly different.
>
>         Which version is now considered correct/preferred?
>         _______________________________________________
>         LLVM Developers mailing list
>         llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
>         https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-- 
https://flowcrypt.com/pub/stefan.graenitz@gmail.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190517/59bf4a50/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190517/59bf4a50/attachment-0001.sig>


More information about the llvm-dev mailing list