<div dir="ltr"><div dir="ltr"><div>Hi Stefan,</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">This is great news! Looking forward to use it for dispatch in the ThinLtoJIT prototype once I resume to my LLVM work.</blockquote><div dir="ltr"><br></div><div>Yes -- I think it will be really handy for that. Hopefully I will get some profiling signposts and logging in to ExecutionSession in the not too distant future too: I think your ThinLtoJIT prototype will make for an interesting in-tree performance stress-test.</div><div dir="ltr"><br></div><div>-- Lang.</div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 20, 2020 at 1:58 AM Stefan Gränitz <<a href="mailto:stefan.graenitz@gmail.com">stefan.graenitz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div>
<p>Hi Lang, thanks again for your updates!<br>
<br>
</p><blockquote type="cite">The Extensible RTTI system (<a href="https://reviews.llvm.org/D39111" target="_blank">https://reviews.llvm.org/D39111</a>)
that I posted a while back has landed. While this is not ORC
specific, I expect it to be used in upcoming patches to allow
ORC clients to check the dynamic type of MaterializationUnits.
This can be used during dispatch to prioritize work by type,
e.g. prioritizing stubs and other trivial-to-materialize
symbols.</blockquote>
This is great news! Looking forward to use it for dispatch in the
ThinLtoJIT prototype once I resume to my LLVM work.<br>
<br>
On 20/04/2020 07:36, Lang Hames wrote:<br>
<p></p>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Hi All,
<div><br>
</div>
<div>There was only one interesting ORC-specific commit this
week: A new example showing how to initialize and
de-initialize JITDylibs has been added in
llvm/examples/OrcV2Examples/LLJITWithInitializers.</div>
<div><br>
</div>
<div>The Extensible RTTI system (<a href="https://reviews.llvm.org/D39111" target="_blank">https://reviews.llvm.org/D39111</a>)
that I posted a while back has landed. While this is not
ORC specific, I expect it to be used in upcoming patches
to allow ORC clients to check the dynamic type of
MaterializationUnits. This can be used during dispatch to
prioritize work by type, e.g. prioritizing stubs and other
trivial-to-materialize symbols.</div>
<div><br>
</div>
<div>Finally, I hope to spend next week working on support
for removable code in OrcV2, which is one of the big
missing features from OrcV1. I expect the API to end up
looking something like this:</div>
<div><br>
</div>
<div><font face="monospace">using ResourceKey = const class
ResourceTracker*;</font></div>
<div><font face="monospace">class ResourceTracker {</font></div>
<div><font face="monospace">public:</font></div>
<div><font face="monospace"> // Return the key for this
tracker (just its address)</font></div>
<div><font face="monospace"> ResourceKey getKey() { return
this; }</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace"> // Emit all not-yet-emitted
symbols covered by this tracker. </font></div>
<div><font face="monospace"> Expected<SymbolMap>
emit();</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace"> // Remove all symbols covered
by this tracker and</font></div>
<div><font face="monospace"> // release resources.</font></div>
<div><font face="monospace"> Error remove();</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace"> // Transfer tracking of all
symbols / resources to the</font></div>
<div><font face="monospace"> // containing JITDylib's</font><span style="font-family:monospace"> tracker.</span></div>
<div><font face="monospace"> void detach();</font></div>
<div><font face="monospace">};</font></div>
<div><br>
</div>
<div>I'm hoping that usage will look like:</div>
<div><br>
</div>
<div><font face="monospace">LLJIT J =
LLJITBuilder().create();</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">// No tracker specified.
Resources tracked by the containing</font></div>
<div><font face="monospace">// JITDylib's tracker, and freed
when the JITDylib is</font></div>
<div><font face="monospace">// deinitialized. </font></div>
<div><font face="monospace">ExitOnErr(J.addIRModule(sdt::move(UntrackedModule)));</font></div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace">// Explicitly specify tracker.
Module symbols can be</font></div>
<div><font face="monospace">// - materialized by calling
T->emit();</font></div>
<div><font face="monospace">// - removed by calling
T->remove();</font></div>
<div><font face="monospace">// - transfered to the JITDylib
by calling T->release();</font></div>
<div><font face="monospace">auto T =
std::make_unique<ResourceTracker>();</font></div>
<div><font face="monospace">ExitOnErr(J.addIRModule(TrackedModule,
T->getKey()));</font></div>
<div><br>
</div>
<div>Early feedback on this API sketch is welcome. Otherwise
I hope to have early reviews / discussion ready in time
for next week.</div>
<div><br>
</div>
<div>-- Lang.</div>
</div>
</div>
</div>
</blockquote>
<pre cols="72">--
<a href="https://flowcrypt.com/pub/stefan.graenitz@gmail.com" target="_blank">https://flowcrypt.com/pub/stefan.graenitz@gmail.com</a></pre>
</div>
</blockquote></div></div></div>