Revision tags: llvmorg-21-init |
|
#
6d12b954 |
| 20-Jan-2025 |
Lang Hames <lhames@gmail.com> |
[ORC] Move EHFrameRegistrationPlugin into its own header + source file. NFC.
|
Revision tags: llvmorg-19.1.7 |
|
#
2d10b7b7 |
| 10-Jan-2025 |
Lang Hames <lhames@gmail.com> |
Reapply "[ORC][llvm-jitlink] Add SimpleLazyReexportsSpeculator..." with fixes.
This reapplies 6d72bf47606, which was reverted in 57447d3ddf to investigate build failures, e.g. https://lab.llvm.org/b
Reapply "[ORC][llvm-jitlink] Add SimpleLazyReexportsSpeculator..." with fixes.
This reapplies 6d72bf47606, which was reverted in 57447d3ddf to investigate build failures, e.g. https://lab.llvm.org/buildbot/#/builders/3/builds/10114.
The original patch contained an invalid unused friend declaration of std::make_shared. This has been removed.
show more ...
|
#
57447d3d |
| 10-Jan-2025 |
Lang Hames <lhames@gmail.com> |
Revert "[ORC][llvm-jitlink] Add SimpleLazyReexportsSpeculator, use in llvm-jitlink."
This reverts commit 6d72bf47606c2a288b911d682fd96129c9c1466d while I fix bot failures.
|
#
6d72bf47 |
| 09-Jan-2025 |
Lang Hames <lhames@gmail.com> |
[ORC][llvm-jitlink] Add SimpleLazyReexportsSpeculator, use in llvm-jitlink.
Also adds a new IdleTask type and updates DynamicThreadPoolTaskDispatcher to schedule IdleTasks whenever the total number
[ORC][llvm-jitlink] Add SimpleLazyReexportsSpeculator, use in llvm-jitlink.
Also adds a new IdleTask type and updates DynamicThreadPoolTaskDispatcher to schedule IdleTasks whenever the total number of threads running is less than the maximum number of MaterializationThreads.
A SimpleLazyReexportsSpeculator instance maintains a list of speculation suggestions ((JITDylib, Function) pairs) and registered lazy reexports. When speculation opportunities are available (having been added via addSpeculationSuggestions or when lazy reexports were created) it schedules an IdleTask that triggers the next speculative lookup as soon as resources are available. Speculation suggestions are processed first, followed by lookups for lazy reexport bodies. A callback can be registered at object construction time to record lazy reexport executions as they happen, and these executions can be fed back into the speculator as suggestions on subsequent executions.
The llvm-jitlink tool is updated to support speculation when lazy linking is used via three new arguments:
-speculate=[none|simple] : When the 'simple' value is specified a SimpleLazyReexportsSpeculator instances is used for speculation.
-speculate-order <path> : Specifies a path to a CSV containing (jit dylib name, function name) triples to use as speculative suggestions in the current run.
-record-lazy-execs <path> : Specifies a path in which to record lazy function executions as a CSV of (jit dylib name, function name) pairs, suitable for use with -speculate-order.
The same path can be passed to -speculate-order and -record-lazy-execs, in which case the file will be overwritten at the end of the execution.
No testcase yet: Speculative linking is difficult to test (since by definition execution behavior should be unaffected by speculation) and this is an new prototype of the concept*. Tests will be added in the future once the interface and behavior settle down.
* An earlier implementation of the speculation concept can be found in llvm/include/llvm/ExecutionEngine/Orc/Speculation.h. Both systems have the same goal (hiding compilation latency) but different mechanisms. This patch relies entirely on information available in the controller, where the old system could receive additional information from the JIT'd runtime via callbacks. I aim to combine the two in the future, but want to gain more practical experience with speculation first.
show more ...
|
#
3cb96484 |
| 08-Jan-2025 |
Lang Hames <lhames@gmail.com> |
[llvm-jitlink] Shut down the session on an error return path.
Ensures cleanup of task dispatcher threads. This may address some of the nondeterministic failures seen in llvm-jitlink regression tests
[llvm-jitlink] Shut down the session on an error return path.
Ensures cleanup of task dispatcher threads. This may address some of the nondeterministic failures seen in llvm-jitlink regression tests recently.
show more ...
|
#
bfb0a518 |
| 08-Jan-2025 |
Lang Hames <lhames@gmail.com> |
[llvm-jitlink] Use -num-threads=0 for regression tests relying on debug output.
ORC and JITLink debugging output write the dbgs() raw_ostream, which isn't thread-safe. Use -num-threads=0 to force si
[llvm-jitlink] Use -num-threads=0 for regression tests relying on debug output.
ORC and JITLink debugging output write the dbgs() raw_ostream, which isn't thread-safe. Use -num-threads=0 to force single-threaded linking for tests that produce debugging output.
The llvm-jitlink tool is updated to suggest -num-threads=0 when debugging output is enabled.
show more ...
|
#
0c681550 |
| 02-Jan-2025 |
Lang Hames <lhames@gmail.com> |
[llvm-jitlink] Fix llvm-jitlink for LLVM_ENABLE_THREADS=Off.
Commit edca1d9bad2 enabled threaded linking by default in llvm-jitlink, but we need to handle the case where LLVM is built with -DLLVM_EN
[llvm-jitlink] Fix llvm-jitlink for LLVM_ENABLE_THREADS=Off.
Commit edca1d9bad2 enabled threaded linking by default in llvm-jitlink, but we need to handle the case where LLVM is built with -DLLVM_ENABLE_THREADS=Off.
This patch updates the llvm-jitlink tool to switch back to materialization on the main thread (equivalent to llvm-jitlink -num-threads=0 ...) when LLVM is built without thread support.
show more ...
|
#
09655153 |
| 02-Jan-2025 |
Lang Hames <lhames@gmail.com> |
"Reapply "[llvm-jitlink] Use concurrent linking by default." with more fixes.
This reapplies edca1d9bad2 which was reverted in 7ec139ad4bc due to bot failures.
LocalDependencyPropagation.s is updat
"Reapply "[llvm-jitlink] Use concurrent linking by default." with more fixes.
This reapplies edca1d9bad2 which was reverted in 7ec139ad4bc due to bot failures.
LocalDependencyPropagation.s is updated to use -num-threads=0 in order to avoid interleaving debugging output.
ELFNixPlatform.h is updated to protect the deferred runtime function calls map during bootstrap.
show more ...
|
#
7ec139ad |
| 24-Dec-2024 |
NAKAMURA Takumi <geek4civic@gmail.com> |
Revert "Reapply "[llvm-jitlink] Use concurrent linking by default." with fixes. (#120958)"
Caused random failures.
This reverts commit 93d4b1f7a72f366c1ea91b2d65991266053be8d9. (llvmorg-20-init-162
Revert "Reapply "[llvm-jitlink] Use concurrent linking by default." with fixes. (#120958)"
Caused random failures.
This reverts commit 93d4b1f7a72f366c1ea91b2d65991266053be8d9. (llvmorg-20-init-16299-g93d4b1f7a72f)
show more ...
|
#
93d4b1f7 |
| 23-Dec-2024 |
Lang Hames <lhames@gmail.com> |
Reapply "[llvm-jitlink] Use concurrent linking by default." with fixes. (#120958)
Reapplies commit edca1d9bad2 which was reverted in 34531cff638 while I
investigated bot failures, (e.g.
https://la
Reapply "[llvm-jitlink] Use concurrent linking by default." with fixes. (#120958)
Reapplies commit edca1d9bad2 which was reverted in 34531cff638 while I
investigated bot failures, (e.g.
https://lab.llvm.org/buildbot/#/builders/137/builds/10791).
Commit 158a60051d2 should address the -check failures on the bots, which
were caused by checks running earlier under the concurrent linking
scheme before all files referenced by the checks had been fully linked.
This patch also fixes the -threads option failure by renaming the option
to -num-threads to avoid clashing with the ThreadCount cl::opt variable
defined in ThinLTOCodeGenerator.cpp.
show more ...
|
#
158a6005 |
| 23-Dec-2024 |
Lang Hames <lhames@gmail.com> |
[llvm-jitlink] Wait for reachable files to link before running checks.
ORC dependence tracking is fine-grained (i.e. per-symbol), however when running -check mode we want to wait for all links trigg
[llvm-jitlink] Wait for reachable files to link before running checks.
ORC dependence tracking is fine-grained (i.e. per-symbol), however when running -check mode we want to wait for all links triggered by the entry point lookup to complete, regardless of whether the code / data in them is actually reachable from the entry point. This simplifies test-cases, since authors don't need to reason about per-symbol dependencies to know that additional files will be linked (if referenced transitively in any way from the test-case).
The new Session::waitForFilesLinkedFromEntryPointFile utility does _not_ wait for lazily linked (-lazy) files.
This will be used to fix buildbot errors caused by edca1d9bad2.
show more ...
|
#
34531cff |
| 23-Dec-2024 |
Lang Hames <lhames@gmail.com> |
Revert "[llvm-jitlink] Use concurrent linking by default."
This reverts commit edca1d9bad2 while I investigate bot failures, e.g. https://lab.llvm.org/buildbot/#/builders/137/builds/10791.
|
#
edca1d9b |
| 23-Dec-2024 |
Lang Hames <lhames@gmail.com> |
[llvm-jitlink] Use concurrent linking by default.
Adds a -threads option to llvm-jitlink. By default llvm-jitlink will now use a DynamicThreadPoolTaskDispatcher with the number of materialization th
[llvm-jitlink] Use concurrent linking by default.
Adds a -threads option to llvm-jitlink. By default llvm-jitlink will now use a DynamicThreadPoolTaskDispatcher with the number of materialization threads set to whatever is returned by std::hardware_concurrency(). This brings the default in-place linking behavior in line with the concurrent linking that is used for -oop-executor and -oop-executor-connect mode.
In-place linking on the main thread can be forced by passing -threads=0.
show more ...
|
Revision tags: llvmorg-19.1.6 |
|
#
646ad49e |
| 10-Dec-2024 |
Lang Hames <lhames@gmail.com> |
[llvm-jitlink] Avoid some SymbolStringPtr copies.
|
#
f2d18a4d |
| 09-Dec-2024 |
Lang Hames <lhames@gmail.com> |
Reapply "[ORC] Introduce LazyReexportsManager, ... (#118923)" with fixes.
This re-applies 570ecdcf8b4, which was reverted in 74e8a37ff32 due to bot failures. This commit renames sysv_resolve.cpp to
Reapply "[ORC] Introduce LazyReexportsManager, ... (#118923)" with fixes.
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.
show more ...
|
#
74e8a37f |
| 09-Dec-2024 |
Lang Hames <lhames@gmail.com> |
Revert "Reapply "[ORC] Introduce LazyReexportsManager, … (#118923)" with fixes"
This reverts commit 41652c6c92958a87b8505b9b1e6f008856e392ac while I investigate more bot failures.
|
#
41652c6c |
| 08-Dec-2024 |
Lang Hames <lhames@gmail.com> |
Reapply "[ORC] Introduce LazyReexportsManager, … (#118923)" with fixes
This reapplies 570ecdcf8b4, which was reverted in 6073dd923b8 due to bot failures.
The test failures on Linux were fixed by: 1
Reapply "[ORC] Introduce LazyReexportsManager, … (#118923)" with fixes
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 -> __orc_rt_sysv_reentry alias to ELFNixPlatform.
show more ...
|
#
6073dd92 |
| 07-Dec-2024 |
Lang Hames <lhames@gmail.com> |
Revert "[ORC] Introduce LazyReexportsManager, JITLinkTrampolines, … (#118923)"
This reverts commit 570ecdcf8b44aec853ce381a5f6b77222b041afa while I investigate bot failures, e.g. https://lab.llvm.or
Revert "[ORC] Introduce LazyReexportsManager, JITLinkTrampolines, … (#118923)"
This reverts commit 570ecdcf8b44aec853ce381a5f6b77222b041afa while I investigate bot failures, e.g. https://lab.llvm.org/buildbot/#/builders/17/builds/4446.
show more ...
|
#
570ecdcf |
| 07-Dec-2024 |
Lang Hames <lhames@gmail.com> |
[ORC] Introduce LazyReexportsManager, JITLinkTrampolines, ORC-RT base… (#118923)
…d reentry.
These utilities provide new, more generic and easier to use support for
lazy compilation in ORC.
L
[ORC] Introduce LazyReexportsManager, JITLinkTrampolines, ORC-RT base… (#118923)
…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 = {
( <entry point symbol #1>, <implementation symbol #1> ),
( <entry point symbol #2>, <implementation symbol #2> ),
...
( <entry point symbol #n>, <implementation symbol #n> )
}
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, <alias map>));
```
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.
show more ...
|
#
2ccf7ed2 |
| 05-Dec-2024 |
Jared Wyles <jared.wyles@gmail.com> |
[JITLink] Switch to SymbolStringPtr for Symbol names (#115796)
Use SymbolStringPtr for Symbol names in LinkGraph. This reduces string interning
on the boundary between JITLink and ORC, and allows p
[JITLink] Switch to SymbolStringPtr for Symbol names (#115796)
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<SymbolStringPool> 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 <lhames@gmail.com>
show more ...
|
Revision tags: llvmorg-19.1.5, llvmorg-19.1.4 |
|
#
224290d4 |
| 18-Nov-2024 |
Lang Hames <lhames@gmail.com> |
[ORC] Add LazyObjectLinkingLayer, lazy-linking support to llvm-jitlink (#116002)
LazyObjectLinkingLayer can be used to add object files that will not be linked
into the executor unless some functio
[ORC] Add LazyObjectLinkingLayer, lazy-linking support to llvm-jitlink (#116002)
LazyObjectLinkingLayer can be used to add object files that will not be linked
into the executor unless some function that they define is called at runtime.
(References to data members defined by these objects will still trigger
immediate linking)
To implement lazy linking, LazyObjectLinkingLayer uses the lazyReexports
utility to construct stubs for each function in a given object file, and an
ObjectLinkingLayer::Plugin to rename the function bodies at link-time. (Data
symbols are not renamed)
The llvm-jitlink utility is extended with a -lazy option that can be
passed before input files or archives to add them using the lazy linking
layer rather than the base ObjectLinkingLayer.
show more ...
|
#
dc11c060 |
| 11-Nov-2024 |
Lang Hames <lhames@gmail.com> |
[ORC] Move absoluteSymbols from Core.h to new AbsoluteSymbols.h header. NFC.
Continuing Core.h clean-up.
If you see any errors about a missing absoluteSymbols function you need to include the new A
[ORC] Move absoluteSymbols from Core.h to new AbsoluteSymbols.h header. NFC.
Continuing Core.h clean-up.
If you see any errors about a missing absoluteSymbols function you need to include the new AbsoluteSymbols.h header.
show more ...
|
#
d822c099 |
| 10-Nov-2024 |
Douglas <8796590+dgg5503@users.noreply.github.com> |
[JITLink] Use `rsplit` on `-sectcreate` argument in llvm-jitlink (#115511)
This accounts for cases where the file path may contain an `@` symbol.
In such cases, the split occurs too early causing a
[JITLink] Use `rsplit` on `-sectcreate` argument in llvm-jitlink (#115511)
This accounts for cases where the file path may contain an `@` symbol.
In such cases, the split occurs too early causing argument parsing to
fail.
show more ...
|
Revision tags: llvmorg-19.1.3 |
|
#
da66f6a2 |
| 22-Oct-2024 |
Kazu Hirata <kazu@google.com> |
[llvm-jitlink] Use heterogenous lookups with std::map (NFC) (#113245)
|
Revision tags: llvmorg-19.1.2 |
|
#
7937fe1a |
| 15-Oct-2024 |
Lang Hames <lhames@gmail.com> |
[ORC][llvm-jitlink] Add support for forced loading of archive members.
This patch adds support for forced loading of archive members, similar to the behavior of the -all_load and -ObjC options in ld
[ORC][llvm-jitlink] Add support for forced loading of archive members.
This patch adds support for forced loading of archive members, similar to the behavior of the -all_load and -ObjC options in ld64. To enable this, the StaticLibraryDefinitionGenerator class constructors are extended with a VisitMember callback that is called on each member file in the archive at generator construction time. This callback can be used to unconditionally add the member file to a JITDylib at that point.
To test this the llvm-jitlink utility is extended with -all_load (all platforms) and -ObjC (darwin only) options. Since we can't refer to symbols in the test objects directly (these would always cause the member to be linked in, even without the new flags) we instead test side-effects of force loading: execution of constructors and registration of Objective-C metadata.
rdar://134446111
show more ...
|