<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp, branch users/chapuni/cov/single/switch</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[ORC][MachO] Avoid another race condition in MachOPlatform bootstrap.</title>
<updated>2025-01-03T06:30:19+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2025-01-03T06:15:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=30b73ed7bd8934c32e4bd5430bccf52a226deabd'/>
<id>30b73ed7bd8934c32e4bd5430bccf52a226deabd</id>
<content type='text'>
Similar to a9e75b1d4d1: During MachOPlatform bootstrap we need to defer actions
until essential platform functionality has been loaded, but the platform itself
may be loaded under a concurrent dispatcher so we have to guard against the
deferred actions vector being accessed concurrently.

This fixes a probablistic failure in the ORC runtime regression tests on
Darwin/x86-64 that was spotted after edca1d9bad2 (which turned on concurrent
linking by default in llvm-jitlink).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Similar to a9e75b1d4d1: During MachOPlatform bootstrap we need to defer actions
until essential platform functionality has been loaded, but the platform itself
may be loaded under a concurrent dispatcher so we have to guard against the
deferred actions vector being accessed concurrently.

This fixes a probablistic failure in the ORC runtime regression tests on
Darwin/x86-64 that was spotted after edca1d9bad2 (which turned on concurrent
linking by default in llvm-jitlink).
</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[ORC] Introduce LazyReexportsManager, ... (#118923)" with fixes.</title>
<updated>2024-12-09T03:22:51+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2024-12-09T01:44:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f2d18a4d00c5f5dea436b4f7b62ec5c87b98eac2'/>
<id>f2d18a4d00c5f5dea436b4f7b62ec5c87b98eac2</id>
<content type='text'>
This re-applies 570ecdcf8b4, which was reverted in 74e8a37ff32 due to bot
failures. This commit renames sysv_resolve.cpp to resolve.cpp, which was the
cause of the config errors.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This re-applies 570ecdcf8b4, which was reverted in 74e8a37ff32 due to bot
failures. This commit renames sysv_resolve.cpp to resolve.cpp, which was the
cause of the config errors.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Reapply "[ORC] Introduce LazyReexportsManager, … (#118923)" with fixes"</title>
<updated>2024-12-09T01:38:59+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2024-12-09T01:38:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=74e8a37ff32e599fd40858e0d6c7e531dcbe4e03'/>
<id>74e8a37ff32e599fd40858e0d6c7e531dcbe4e03</id>
<content type='text'>
This reverts commit 41652c6c92958a87b8505b9b1e6f008856e392ac while I investigate
more bot failures.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 41652c6c92958a87b8505b9b1e6f008856e392ac while I investigate
more bot failures.
</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[ORC] Introduce LazyReexportsManager, … (#118923)" with fixes</title>
<updated>2024-12-09T01:08:07+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2024-12-08T23:11:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=41652c6c92958a87b8505b9b1e6f008856e392ac'/>
<id>41652c6c92958a87b8505b9b1e6f008856e392ac</id>
<content type='text'>
This reapplies 570ecdcf8b4, which was reverted in 6073dd923b8 due to bot
failures.

The test failures on Linux were fixed by:
1. Removing an overly restrictive assertion (query dependence on a symbol no
longer implies a MaterializingInfo for that symbol)
2. Adding reentry and resolver files to the ORC runtime CMakeLists.txt for
Linux.
3. Adding the __orc_rt_reentry -&gt; __orc_rt_sysv_reentry alias to ELFNixPlatform.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reapplies 570ecdcf8b4, which was reverted in 6073dd923b8 due to bot
failures.

The test failures on Linux were fixed by:
1. Removing an overly restrictive assertion (query dependence on a symbol no
longer implies a MaterializingInfo for that symbol)
2. Adding reentry and resolver files to the ORC runtime CMakeLists.txt for
Linux.
3. Adding the __orc_rt_reentry -&gt; __orc_rt_sysv_reentry alias to ELFNixPlatform.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[ORC] Introduce LazyReexportsManager, JITLinkTrampolines, … (#118923)"</title>
<updated>2024-12-07T11:15:27+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2024-12-07T11:15:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6073dd923b82a526803d1f85f3531bc0a0721a88'/>
<id>6073dd923b82a526803d1f85f3531bc0a0721a88</id>
<content type='text'>
This reverts commit 570ecdcf8b44aec853ce381a5f6b77222b041afa while I investigate
bot failures, e.g. https://lab.llvm.org/buildbot/#/builders/17/builds/4446.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 570ecdcf8b44aec853ce381a5f6b77222b041afa while I investigate
bot failures, e.g. https://lab.llvm.org/buildbot/#/builders/17/builds/4446.
</pre>
</div>
</content>
</entry>
<entry>
<title>[ORC] Introduce LazyReexportsManager, JITLinkTrampolines, ORC-RT base… (#118923)</title>
<updated>2024-12-07T10:08:39+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2024-12-07T10:08:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=570ecdcf8b44aec853ce381a5f6b77222b041afa'/>
<id>570ecdcf8b44aec853ce381a5f6b77222b041afa</id>
<content type='text'>
…d reentry.

These utilities provide new, more generic and easier to use support for
lazy compilation in ORC.

LazyReexportsManager is an alternative to LazyCallThroughManager. It
takes requests for lazy re-entry points in the form of an alias map:
lazy-reexports = {
  ( &lt;entry point symbol #1&gt;, &lt;implementation symbol #1&gt; ),
  ( &lt;entry point symbol #2&gt;, &lt;implementation symbol #2&gt; ),
  ...
  ( &lt;entry point symbol #n&gt;, &lt;implementation symbol #n&gt; )
}

LazyReexportsManager then:
1. binds the entry points to the implementation names in an internal
table.
2. creates a JIT re-entry trampoline for each entry point.
3. creates a redirectable symbol for each of the entry point name and
binds redirectable symbol to the corresponding reentry trampoline.

When an entry point symbol is first called at runtime (which may be on
any thread of the JIT'd program) it will re-enter the JIT via the
trampoline and trigger a lookup for the implementation symbol stored in
LazyReexportsManager's internal table. When the lookup completes the
entry point symbol will be updated (via the RedirectableSymbolManager)
to point at the implementation symbol, and execution will proceed to the
implementation symbol.

Actual construction of the re-entry trampolines and redirectable symbols
is delegated to an EmitTrampolines functor and the
RedirectableSymbolsManager respectively.

JITLinkReentryTrampolines.h provides a JITLink-based implementation of
the EmitTrampolines functor. (AArch64 only in this patch, but other
architectures will be added in the near future).

Register state save and reentry functionality is added to the ORC
runtime in the __orc_rt_sysv_resolve and __orc_rt_resolve_implementation
functions (the latter is generic, the former will need custom
implementations for each ABI and architecture to be supported, however
this should be much less effort than the existing OrcABISupport
approach, since the ORC runtime allows this code to be written as native
assembly).

The resulting system:
1. Works equally well for in-process and out-of-process JIT'd code.
2. Requires less boilerplate to set up.

Given an ObjectLinkingLayer and PlatformJD (JITDylib containing the ORC
runtime), setup is just:

```c++
auto RSMgr = JITLinkRedirectableSymbolManager::Create(OLL);
if (!RSMgr)
  return RSMgr.takeError();

auto LRMgr = createJITLinkLazyReexportsManager(OLL, **RSMgr, PlatformJD);
if (!LRMgr)
  return LRMgr.takeError();
```

after which lazy reexports can be introduced with:

```c++
JD.define(lazyReexports(LRMgr, &lt;alias map&gt;));
```

LazyObectLinkingLayer is updated to use this new method, but the LLVM-IR
level CompileOnDemandLayer will continue to use LazyCallThroughManager
and OrcABISupport until the new system supports a wider range of
architectures and ABIs.

The llvm-jitlink utility's -lazy option now uses the new scheme. Since
it depends on the ORC runtime, the lazy-link.ll testcase and associated
helpers are moved to the ORC runtime.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
…d reentry.

These utilities provide new, more generic and easier to use support for
lazy compilation in ORC.

LazyReexportsManager is an alternative to LazyCallThroughManager. It
takes requests for lazy re-entry points in the form of an alias map:
lazy-reexports = {
  ( &lt;entry point symbol #1&gt;, &lt;implementation symbol #1&gt; ),
  ( &lt;entry point symbol #2&gt;, &lt;implementation symbol #2&gt; ),
  ...
  ( &lt;entry point symbol #n&gt;, &lt;implementation symbol #n&gt; )
}

LazyReexportsManager then:
1. binds the entry points to the implementation names in an internal
table.
2. creates a JIT re-entry trampoline for each entry point.
3. creates a redirectable symbol for each of the entry point name and
binds redirectable symbol to the corresponding reentry trampoline.

When an entry point symbol is first called at runtime (which may be on
any thread of the JIT'd program) it will re-enter the JIT via the
trampoline and trigger a lookup for the implementation symbol stored in
LazyReexportsManager's internal table. When the lookup completes the
entry point symbol will be updated (via the RedirectableSymbolManager)
to point at the implementation symbol, and execution will proceed to the
implementation symbol.

Actual construction of the re-entry trampolines and redirectable symbols
is delegated to an EmitTrampolines functor and the
RedirectableSymbolsManager respectively.

JITLinkReentryTrampolines.h provides a JITLink-based implementation of
the EmitTrampolines functor. (AArch64 only in this patch, but other
architectures will be added in the near future).

Register state save and reentry functionality is added to the ORC
runtime in the __orc_rt_sysv_resolve and __orc_rt_resolve_implementation
functions (the latter is generic, the former will need custom
implementations for each ABI and architecture to be supported, however
this should be much less effort than the existing OrcABISupport
approach, since the ORC runtime allows this code to be written as native
assembly).

The resulting system:
1. Works equally well for in-process and out-of-process JIT'd code.
2. Requires less boilerplate to set up.

Given an ObjectLinkingLayer and PlatformJD (JITDylib containing the ORC
runtime), setup is just:

```c++
auto RSMgr = JITLinkRedirectableSymbolManager::Create(OLL);
if (!RSMgr)
  return RSMgr.takeError();

auto LRMgr = createJITLinkLazyReexportsManager(OLL, **RSMgr, PlatformJD);
if (!LRMgr)
  return LRMgr.takeError();
```

after which lazy reexports can be introduced with:

```c++
JD.define(lazyReexports(LRMgr, &lt;alias map&gt;));
```

LazyObectLinkingLayer is updated to use this new method, but the LLVM-IR
level CompileOnDemandLayer will continue to use LazyCallThroughManager
and OrcABISupport until the new system supports a wider range of
architectures and ABIs.

The llvm-jitlink utility's -lazy option now uses the new scheme. Since
it depends on the ORC runtime, the lazy-link.ll testcase and associated
helpers are moved to the ORC runtime.</pre>
</div>
</content>
</entry>
<entry>
<title>[JITLink] Switch to SymbolStringPtr for Symbol names (#115796)</title>
<updated>2024-12-05T23:22:09+00:00</updated>
<author>
<name>Jared Wyles</name>
<email>jared.wyles@gmail.com</email>
</author>
<published>2024-12-05T23:22:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2ccf7ed277df28651b94bbee9fccefdf22fb074f'/>
<id>2ccf7ed277df28651b94bbee9fccefdf22fb074f</id>
<content type='text'>
Use SymbolStringPtr for Symbol names in LinkGraph. This reduces string interning
on the boundary between JITLink and ORC, and allows pointer comparisons (rather
than string comparisons) between Symbol names. This should improve the
performance and readability of code that bridges between JITLink and ORC (e.g.
ObjectLinkingLayer and ObjectLinkingLayer::Plugins).

To enable use of SymbolStringPtr a std::shared_ptr&lt;SymbolStringPool&gt; is added to
LinkGraph and threaded through to its construction sites in LLVM and Bolt. All
LinkGraphs that are to have symbol names compared by pointer equality must point
to the same SymbolStringPool instance, which in ORC sessions should be the pool
attached to the ExecutionSession.
---------

Co-authored-by: Lang Hames &lt;lhames@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use SymbolStringPtr for Symbol names in LinkGraph. This reduces string interning
on the boundary between JITLink and ORC, and allows pointer comparisons (rather
than string comparisons) between Symbol names. This should improve the
performance and readability of code that bridges between JITLink and ORC (e.g.
ObjectLinkingLayer and ObjectLinkingLayer::Plugins).

To enable use of SymbolStringPtr a std::shared_ptr&lt;SymbolStringPool&gt; is added to
LinkGraph and threaded through to its construction sites in LLVM and Bolt. All
LinkGraphs that are to have symbol names compared by pointer equality must point
to the same SymbolStringPool instance, which in ORC sessions should be the pool
attached to the ExecutionSession.
---------

Co-authored-by: Lang Hames &lt;lhames@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Re-apply "[ORC][JITLink] Add jitlink::Scope::SideEffectsOnly" with fixes.</title>
<updated>2024-12-03T08:00:29+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2024-12-03T07:12:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d09707070c7460d0887eae8f7022e816510d5eb1'/>
<id>d09707070c7460d0887eae8f7022e816510d5eb1</id>
<content type='text'>
This reapplies aba6bb0820b, which was reverted in 28e2a891210 due to bot
failures. It contains fixes to silence warnings for uncovered switches,
and for incorrect initializer-symbol handling on ELF and COFF.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reapplies aba6bb0820b, which was reverted in 28e2a891210 due to bot
failures. It contains fixes to silence warnings for uncovered switches,
and for incorrect initializer-symbol handling on ELF and COFF.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[ORC][JITLink] Add jitlink::Scope::SideEffectsOnly, use it in ORC Platforms."</title>
<updated>2024-12-03T05:56:23+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2024-12-03T05:56:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=28e2a8912102ac442166a593f2efb15c5bd30346'/>
<id>28e2a8912102ac442166a593f2efb15c5bd30346</id>
<content type='text'>
This reverts commit aba6bb0820b247d4caf4b5e00810909214a58053 while I investigate bot
failures (e.g. https://lab.llvm.org/buildbot/#/builders/143/builds/3848)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit aba6bb0820b247d4caf4b5e00810909214a58053 while I investigate bot
failures (e.g. https://lab.llvm.org/buildbot/#/builders/143/builds/3848)
</pre>
</div>
</content>
</entry>
<entry>
<title>[ORC][JITLink] Add jitlink::Scope::SideEffectsOnly, use it in ORC Platforms.</title>
<updated>2024-12-03T04:36:03+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2024-12-03T04:30:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=aba6bb0820b247d4caf4b5e00810909214a58053'/>
<id>aba6bb0820b247d4caf4b5e00810909214a58053</id>
<content type='text'>
SideEffectsOnly is a new jitlink::Scope value that corresponds to the
JITSymbolFlags::MaterializationSideEffectsOnly flag: Symbols with this scope
can be looked up (and form part of the initial interface of a LinkGraph) but
never actually resolve to an address (so can only be looked up with a
WeaklyReferencedSymbol lookup).

Previously ObjectLinkingLayer implicitly treated JITLink symbols as having this
scope, regardless of a Symbol's actual scope, if the
MaterializationSideEffectsOnly flag was set on the corresponding symbol in the
MaterializationResponsibility object. Using an explicit scope in JITLink for
this (1) allows JITLink plugins to identify and correctly handle
side-effects-only symbols, and (2) allows raw LinkGraphs to define
side-effects-only symbols without clients having to manually modify their
`MaterializationUnit::Interface`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SideEffectsOnly is a new jitlink::Scope value that corresponds to the
JITSymbolFlags::MaterializationSideEffectsOnly flag: Symbols with this scope
can be looked up (and form part of the initial interface of a LinkGraph) but
never actually resolve to an address (so can only be looked up with a
WeaklyReferencedSymbol lookup).

Previously ObjectLinkingLayer implicitly treated JITLink symbols as having this
scope, regardless of a Symbol's actual scope, if the
MaterializationSideEffectsOnly flag was set on the corresponding symbol in the
MaterializationResponsibility object. Using an explicit scope in JITLink for
this (1) allows JITLink plugins to identify and correctly handle
side-effects-only symbols, and (2) allows raw LinkGraphs to define
side-effects-only symbols without clients having to manually modify their
`MaterializationUnit::Interface`.
</pre>
</div>
</content>
</entry>
</feed>
