|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1 |
|
| #
fe2f5c97 |
| 08-Feb-2022 |
Lang Hames <[email protected]> |
[ORC-RT] Fix missing #include from f9aef477ebc.
|
| #
f9aef477 |
| 08-Feb-2022 |
Lang Hames <[email protected]> |
[ORC][ORC-RT] Rewrite the MachO platform to use allocation actions.
This patch updates the MachO platform (both the ORC MachOPlatform class and the ORC-Runtime macho_platform.* files) to use allocat
[ORC][ORC-RT] Rewrite the MachO platform to use allocation actions.
This patch updates the MachO platform (both the ORC MachOPlatform class and the ORC-Runtime macho_platform.* files) to use allocation actions, rather than EPC calls, to transfer the initializer information scraped from each linked object. Interactions between the ORC and ORC-Runtime sides of the platform are substantially redesigned to accomodate the change.
The high-level changes in this patch are:
1. The MachOPlatform::setupJITDylib method now calls into the runtime to set up a dylib name <-> header mapping, and a dylib state object (JITDylibState).
2. The MachOPlatformPlugin builds an allocation action that calls the __orc_rt_macho_register_object_platform_sections and __orc_rt_macho_deregister_object_platform_sections functions in the runtime to register the address ranges for all "interesting" sections in the object being allocated (TLS data sections, initializers, language runtime metadata sections, etc.).
3. The MachOPlatform::rt_getInitializers method (the entry point in the controller for requests from the runtime for initializer information) is replaced by MachOPlatform::rt_pushInitializers. The former returned a data structure containing the "interesting" section address ranges, but these are now handled by __orc_rt_macho_register_object_platform_sections. The new rt_pushInitializers method first issues a lookup to trigger materialization of the "interesting" sections, then returns the dylib dependence tree rooted at the requested dylib for dlopen to consume. (The dylib dependence tree is returned by rt_pushInitializers, rather than being handled by some dedicated call, because rt_pushInitializers can alter the dependence tree).
The advantage of these changes (beyond the performance advantages of using allocation actions) is that it moves more information about the materialized portions of the JITDylib into the executor. This tends to make the runtime easier to reason about, e.g. the implementation of dlopen in the runtime is now recursive, rather than relying on recursive calls in the controller to build a linear data structure for consumption by the runtime. This change can also make some operations more efficient, e.g. JITDylibs can be dlclosed and then re-dlopened without having to pull all initializers over from the controller again.
In addition to the high-level changes, there are some low-level changes to ORC and the runtime:
* In ORC, at ExecutionSession teardown time JITDylibs are now destroyed in reverse creation order. This is on the assumption that the ORC runtime will be loaded into an earlier dylib that will be used by later JITDylibs. This is a short-term solution to crashes that arose during testing when the runtime was torn down before its users. Longer term we will likely destroy dylibs in dependence order.
* toSPSSerializable(Expected<T> E) is updated to explicitly initialize the T value, allowing it to be used by Ts that have explicit constructors.
* The ORC runtime now (1) attempts to track ref-counts, and (2) distinguishes not-yet-processed "interesting" sections from previously processed ones. (1) is necessary for standard dlopen/dlclose emulation. (2) is intended as a step towards better REPL support -- it should enable future runtime calls that run only newly registered initializers ("dlopen_more", "dlopen_additions", ...?).
show more ...
|
|
Revision tags: llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3 |
|
| #
1088c78c |
| 16-Jan-2022 |
Lang Hames <[email protected]> |
[ORC-RT] Remove some stale comments.
We switched to SPS serialization for these functions in 089acf25223d2.
|
| #
0ede1b90 |
| 16-Jan-2022 |
Lang Hames <[email protected]> |
[ORC-RT] Update WrapperFunctionCall for 089acf25223.
089acf25223 updated WrapperFunctionCall to carry arbitrary argument payloads (rather than plain address ranges). This commit implements the corre
[ORC-RT] Update WrapperFunctionCall for 089acf25223.
089acf25223 updated WrapperFunctionCall to carry arbitrary argument payloads (rather than plain address ranges). This commit implements the corresponding update for the ORC runtime.
show more ...
|
|
Revision tags: llvmorg-13.0.1-rc2 |
|
| #
089acf25 |
| 08-Jan-2022 |
Lang Hames <[email protected]> |
[ORC][JITLink] Merge JITLink AllocActionCall and ORC WrapperFunctionCall.
These types performed identical roles. Merging them simplifies interoperability between JITLink and ORC APIs (allowing us to
[ORC][JITLink] Merge JITLink AllocActionCall and ORC WrapperFunctionCall.
These types performed identical roles. Merging them simplifies interoperability between JITLink and ORC APIs (allowing us to address a few FIXMEs).
show more ...
|
|
Revision tags: llvmorg-13.0.1-rc1 |
|
| #
2a739f27 |
| 12-Nov-2021 |
Ben Langmuir <[email protected]> |
[ORC][ORC-RT] Register type metadata from __swift5_types MachO section
Similar to how the other swift sections are registered by the ORC runtime's macho platform, add the __swift5_types section, whi
[ORC][ORC-RT] Register type metadata from __swift5_types MachO section
Similar to how the other swift sections are registered by the ORC runtime's macho platform, add the __swift5_types section, which contains type metadata. Add a simple test that demonstrates that the swift runtime recognized the registered types.
rdar://85358530
Differential Revision: https://reviews.llvm.org/D113811
show more ...
|
| #
3fb64161 |
| 12-Nov-2021 |
Lang Hames <[email protected]> |
[ORC-RT][llvm-jitlink] Fix a buggy check in ORC-RT MachO TLV deregistration.
The check was failing because it was matching against the end of the range, not the start.
This bug wasn't causing the O
[ORC-RT][llvm-jitlink] Fix a buggy check in ORC-RT MachO TLV deregistration.
The check was failing because it was matching against the end of the range, not the start.
This bug wasn't causing the ORC-RT MachO TLV regression test to fail because we were only logging deallocation errors (including TLV deregistration errors) and not actually returning a failure code. This commit updates llvm-jitlink to report the errors properly.
show more ...
|
| #
ff846fcb |
| 31-Oct-2021 |
Lang Hames <[email protected]> |
[ORC][ORC-RT] Switch MachO EH/TLV registration from EPC-calls to alloc actions.
MachOPlatform used to make an EPC-call (registerObjectSections) to register the eh-frame and thread-data sections for
[ORC][ORC-RT] Switch MachO EH/TLV registration from EPC-calls to alloc actions.
MachOPlatform used to make an EPC-call (registerObjectSections) to register the eh-frame and thread-data sections for each linked object with the ORC runtime.
Now that JITLinkMemoryManager supports allocation actions we can use these instead of an EPC call. This saves us one EPC-call per object linked, and manages registration/deregistration in the executor, rather than the controller process. In the future we may use this to allow JIT'd code in the executor to outlive the controller object while still being able to be cleanly destroyed.
Since the code for allocation actions must be available when the actions are run, and since the eh-frame registration code lives in the ORC runtime itself, this change required that MachO eh-frame support be split out of macho_platform.cpp and into its own macho_ehframe_registration.cpp file that has no other dependencies. During bootstrap we start by forcing emission of macho_ehframe_registration.cpp so that eh-frame registration is guaranteed to be available for the rest of the bootstrap process. Then we load the rest of the MachO-platform runtime support, erroring out if there is any attempt to use TLVs. Once the bootstrap process is complete all subsequent code can use all features.
show more ...
|
| #
beb3d482 |
| 27-Oct-2021 |
Ben Langmuir <[email protected]> |
[ORC-RT] Fix objc selector corruption
We were writing a pointer to a selector string into the contents of a string instead of overwriting the pointer to the string, leading to corruption. This was c
[ORC-RT] Fix objc selector corruption
We were writing a pointer to a selector string into the contents of a string instead of overwriting the pointer to the string, leading to corruption. This was causing non-deterministic failures of the 'trivial-objc-methods' test case.
Differential Revision: https://reviews.llvm.org/D112671
show more ...
|
| #
5c723231 |
| 20-Oct-2021 |
Lang Hames <[email protected]> |
[ORC-RT] Remove stray printf debugging output.
These were accidentally picked up in an earlier commit.
|
| #
897eb579 |
| 25-Sep-2021 |
Lang Hames <[email protected]> |
[ORC-RT] ExecutorAddrDiff ergonomic improvements; contains and overlaps methods
Renames StartAddress and EndAddress members to Start and End.
Adds contains and overlap methods.
Adds a constructor
[ORC-RT] ExecutorAddrDiff ergonomic improvements; contains and overlaps methods
Renames StartAddress and EndAddress members to Start and End.
Adds contains and overlap methods.
Adds a constructor from an address and size.
These changes are counterparts to LLVM commits ef391df2b6332, c0d889995e708, and 37f1b7a3f35fd.
show more ...
|
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4 |
|
| #
0820fbab |
| 24-Sep-2021 |
Lang Hames <[email protected]> |
[ORC-RT] Rename ExecutorAddress to ExecutorAddr.
This is an ORC-runtime counterpart to LLVM commit ef391df2b63, and the motivation is the same: to move to a shorter name to improve the ergonomics of
[ORC-RT] Rename ExecutorAddress to ExecutorAddr.
This is an ORC-runtime counterpart to LLVM commit ef391df2b63, and the motivation is the same: to move to a shorter name to improve the ergonomics of this type before it's more widely adopted.
show more ...
|
|
Revision tags: llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init |
|
| #
cdcc3547 |
| 26-Jul-2021 |
Lang Hames <[email protected]> |
[ORC][ORC-RT] Add initial Objective-C and Swift support to MachOPlatform.
This allows ORC to execute code containing Objective-C and Swift classes and methods (provided that the language runtime is
[ORC][ORC-RT] Add initial Objective-C and Swift support to MachOPlatform.
This allows ORC to execute code containing Objective-C and Swift classes and methods (provided that the language runtime is loaded into the executor).
show more ...
|
| #
eda6afda |
| 22-Jul-2021 |
Lang Hames <[email protected]> |
Re-re-re-apply "[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."
The ccache builders have recevied a config update that should eliminate the build issues seen previously.
|
| #
402b681f |
| 22-Jul-2021 |
Lang Hames <[email protected]> |
Re-re-revert "[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."
This reverts commit 6b2a96285b9bbe92d2c5e21830f21458f8be976d.
The ccache builders are still failing. Looks like they ne
Re-re-revert "[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."
This reverts commit 6b2a96285b9bbe92d2c5e21830f21458f8be976d.
The ccache builders are still failing. Looks like they need to be updated to get the llvm-zorg config change in 490633945677656ba75d42ff1ca9d4a400b7b243.
I'll re-apply this as soon as the builders are updated.
show more ...
|
| #
6b2a9628 |
| 21-Jul-2021 |
Lang Hames <[email protected]> |
Re-re-apply "[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."
This reapplies commit a7733e9556b5a6334c910f88bcd037e84e17e3fc ("Re-apply [ORC][ORC-RT] Add initial native-TLV support to
Re-re-apply "[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."
This reapplies commit a7733e9556b5a6334c910f88bcd037e84e17e3fc ("Re-apply [ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."), and d4abdefc998a1ee19d5edc79ec233774cbf64f6a ("[ORC-RT] Rename macho_tlv.x86-64.s to macho_tlv.x86-64.S (uppercase suffix)").
These patches were reverted in 48aa82cacbff10e1c5395a03f86488bf449ba4da while I investigated bot failures (e.g. https://lab.llvm.org/buildbot/#/builders/109/builds/18981). The fix was to disable building of the ORC runtime on buliders using ccache (which is the same fix used for other compiler-rt projects containing assembly code). This fix was commited to llvm-zorg in 490633945677656ba75d42ff1ca9d4a400b7b243.
show more ...
|
| #
48aa82ca |
| 21-Jul-2021 |
Lang Hames <[email protected]> |
[ORC][ORC-RT] Revert MachO TLV patches while I investigate more bot failures.
This reverts commit d4abdefc998a1ee19d5edc79ec233774cbf64f6a ("[ORC-RT] Rename macho_tlv.x86-64.s to macho_tlv.x86-64.S
[ORC][ORC-RT] Revert MachO TLV patches while I investigate more bot failures.
This reverts commit d4abdefc998a1ee19d5edc79ec233774cbf64f6a ("[ORC-RT] Rename macho_tlv.x86-64.s to macho_tlv.x86-64.S (uppercase suffix)", and a7733e9556b5a6334c910f88bcd037e84e17e3fc ("Re-apply "[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."), while I investigate failures on ccache builders (e.g. https://lab.llvm.org/buildbot/#/builders/109/builds/18981)
show more ...
|
| #
a7733e95 |
| 20-Jul-2021 |
Lang Hames <[email protected]> |
Re-apply "[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."
Reapplies fe1fa43f16beac1506a2e73a9f7b3c81179744eb, which was reverted in 6d8c63946cc259c0af02584b7cc690dde11dea35, with fix
Re-apply "[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."
Reapplies fe1fa43f16beac1506a2e73a9f7b3c81179744eb, which was reverted in 6d8c63946cc259c0af02584b7cc690dde11dea35, with fixes:
1. Remove .subsections_via_symbols directive from macho_tlv.x86-64.s (it's not needed here anyway).
2. Return error from pthread_key_create to the MachOPlatform to silence unused variable warning.
show more ...
|
| #
6d8c6394 |
| 20-Jul-2021 |
Lang Hames <[email protected]> |
Revert "[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."
Reverts commit fe1fa43f16beac1506a2e73a9f7b3c81179744eb while I investigate failures on Linux.
|
| #
fe1fa43f |
| 20-Jul-2021 |
Lang Hames <[email protected]> |
[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform.
Adds code to LLVM (MachOPlatform) and the ORC runtime to support native MachO thread local variables. Adding new TLVs to a JITDylib at
[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform.
Adds code to LLVM (MachOPlatform) and the ORC runtime to support native MachO thread local variables. Adding new TLVs to a JITDylib at runtime is supported.
On the LLVM side MachOPlatform is updated to:
1. Identify thread local variables in the LinkGraph and lower them to GOT accesses to data in the __thread_data or __thread_bss sections.
2. Merge and report the address range of __thread_data and thread_bss sections to the runtime.
On the ORC runtime a MachOTLVManager class introduced which records the address range of thread data/bss sections, and creates thread-local instances from the initial data on demand. An orc-runtime specific tlv_get_addr implementation is included which saves all register state then calls the MachOTLVManager to get the address of the requested variable for the current thread.
show more ...
|
| #
8afa4c40 |
| 19-Jul-2021 |
Lang Hames <[email protected]> |
[ORC-RT] Introduce a ORC_RT_JIT_DISPATCH_TAG macro.
This macro can be used to define tag variables for use with jit-dispatch.
|
| #
11c11006 |
| 19-Jul-2021 |
Lang Hames <[email protected]> |
[ORC-RT] Separate jit-dispach tag decls from definitions.
This should eliminate the "initialized and declared 'extern'" warnings produced on some bots, e.g. https://lab.llvm.org/buildbot/#/builders/
[ORC-RT] Separate jit-dispach tag decls from definitions.
This should eliminate the "initialized and declared 'extern'" warnings produced on some bots, e.g. https://lab.llvm.org/buildbot/#/builders/165/builds/3770
show more ...
|
| #
bb5f97e3 |
| 14-Jul-2021 |
Lang Hames <[email protected]> |
[ORC][ORC-RT] Introduce ORC-runtime based MachO-Platform.
Adds support for MachO static initializers/deinitializers and eh-frame registration via the ORC runtime.
This commit introduces cooperative
[ORC][ORC-RT] Introduce ORC-runtime based MachO-Platform.
Adds support for MachO static initializers/deinitializers and eh-frame registration via the ORC runtime.
This commit introduces cooperative support code into the ORC runtime and ORC LLVM libraries (especially the MachOPlatform class) to support macho runtime features for JIT'd code. This commit introduces support for static initializers, static destructors (via cxa_atexit interposition), and eh-frame registration. Near-future commits will add support for MachO native thread-local variables, and language runtime registration (e.g. for Objective-C and Swift).
The llvm-jitlink tool is updated to use the ORC runtime where available, and regression tests for the new MachOPlatform support are added to compiler-rt.
Notable changes on the ORC runtime side:
1. The new macho_platform.h / macho_platform.cpp files contain the bulk of the runtime-side support. This includes eh-frame registration; jit versions of dlopen, dlsym, and dlclose; a cxa_atexit interpose to record static destructors, and an '__orc_rt_macho_run_program' function that defines running a JIT'd MachO program in terms of the jit- dlopen/dlsym/dlclose functions.
2. Replaces JITTargetAddress (and casting operations) with ExecutorAddress (copied from LLVM) to improve type-safety of address management.
3. Adds serialization support for ExecutorAddress and unordered_map types to the runtime-side Simple Packed Serialization code.
4. Adds orc-runtime regression tests to ensure that static initializers and cxa-atexit interposes work as expected.
Notable changes on the LLVM side:
1. The MachOPlatform class is updated to:
1.1. Load the ORC runtime into the ExecutionSession. 1.2. Set up standard aliases for macho-specific runtime functions. E.g. ___cxa_atexit -> ___orc_rt_macho_cxa_atexit. 1.3. Install the MachOPlatformPlugin to scrape LinkGraphs for information needed to support MachO features (e.g. eh-frames, mod-inits), and communicate this information to the runtime. 1.4. Provide entry-points that the runtime can call to request initializers, perform symbol lookup, and request deinitialiers (the latter is implemented as an empty placeholder as macho object deinits are rarely used). 1.5. Create a MachO header object for each JITDylib (defining the __mh_header and __dso_handle symbols).
2. The llvm-jitlink tool (and llvm-jitlink-executor) are updated to use the runtime when available.
3. A `lookupInitSymbolsAsync` method is added to the Platform base class. This can be used to issue an async lookup for initializer symbols. The existing `lookupInitSymbols` method is retained (the GenericIRPlatform code is still using it), but is deprecated and will be removed soon.
4. JIT-dispatch support code is added to ExecutorProcessControl.
The JIT-dispatch system allows handlers in the JIT process to be associated with 'tag' symbols in the executor, and allows the executor to make remote procedure calls back to the JIT process (via __orc_rt_jit_dispatch) using those tags.
The primary use case is ORC runtime code that needs to call bakc to handlers in orc::Platform subclasses. E.g. __orc_rt_macho_jit_dlopen calling back to MachOPlatform::rt_getInitializers using __orc_rt_macho_get_initializers_tag. (The system is generic however, and could be used by non-runtime code).
The new ExecutorProcessControl::JITDispatchInfo struct provides the address (in the executor) of the jit-dispatch function and a jit-dispatch context object, and implementations of the dispatch function are added to SelfExecutorProcessControl and OrcRPCExecutorProcessControl.
5. OrcRPCTPCServer is updated to support JIT-dispatch calls over ORC-RPC.
6. Serialization support for StringMap is added to the LLVM-side Simple Packed Serialization code.
7. A JITLink::allocateBuffer operation is introduced to allocate writable memory attached to the graph. This is used by the MachO header synthesis code, and will be generically useful for other clients who want to create new graph content from scratch.
show more ...
|