summaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.cpp
AgeCommit message (Collapse)Author
2025-05-04[llvm] Remove unused local variables (NFC) (#138467)Kazu Hirata
2025-03-12[ORC] Drop EHFrameRegistrar, register eh-frames with AllocActions (#130719)Lang Hames
This simplifies resource management, and should improve performance for most use cases.
2024-11-19[ExecutionEngine] Remove unused includes (NFC) (#116749)Kazu Hirata
Identified with misc-include-cleaner.
2023-08-23[ORC] Use EPC bootstrap symbols to communicate eh-frame registration fn addrs.Lang Hames
By using bootstrap symbols to communicate these addresseses, rather than dlsym lookups, we no longer need them to be exported from the main executable. On ELF, where symbols aren't exported from the main executable by default, this eliminates a common source of missing symbol errors and allows for smaller executables (if exports from the main executable aren't otherwise needed and can be removed).
2023-04-02[ORC] Add a generic bootstrap key-value store to SimpleRemoteEPC.Lang Hames
SimpleRemoteEPC already included a "bootstrap symbols map" that could be used to communicate the addresses of symbols needed for JIT bootstrap. The new bootstrap map can be used to communicate arbitrary bootstrap values (encoded as SPS buffers). The bootstrap symbols map is kept as distinct becasue bootstrap symbols are significant, and having a known value type for them allows for better debug logging (we know how to render the values) and tooling (e.g. utils for adding all bootstrap symbols to a JITDylib).
2023-03-31[ORC] Remove more unnecessary ExecutorAddr::getValue calls.Lang Hames
2023-02-10[NFC][TargetParser] Replace uses of llvm/Support/Host.hArchibald Elliott
The forwarding header is left in place because of its use in `polly/lib/External/isl/interface/extract_interface.cc`, but I have added a GCC warning about the fact it is deprecated, because it is used in `isl` from where it is included by Polly.
2022-02-06[llvm] Use = default (NFC)Kazu Hirata
2021-10-30[ORC] Move CWrapperFunctionResult out of the detail:: namespace.Lang Hames
This type has been moved up into the llvm::orc::shared namespace. This type was originally put in the detail:: namespace on the assumption that few (if any) LLVM source files would need to use it. In practice it has been needed in many places, and will continue to be needed until/unless OrcTargetProcess is fully merged into the ORC runtime.
2021-10-08Revert "[ORC] Move SimpleRemoteEPCServer::Dispatcher into OrcShared."Lang Hames
This reverts commit dfd74db9813b0c7c64038c303726ba43f335e07a. SimpleRemoteEPC should share dispatch with the ExecutionSession, rather than having two different dispatch systems on the controller side. SimpleRemoteEPCServer::Dispatch doesn't need to be shared.
2021-10-08[ORC] Remove a stale comment.Lang Hames
SimpleRemoteEPCServer Service shutdown (c965fde7c234a) takes care of this.
2021-10-08[ORC] Move SimpleRemoteEPCServer::Dispatcher into OrcShared.Lang Hames
Renames SimpleRemoteEPCServer::Dispatcher to SimpleRemoteEPCDispatcher and moves it into OrcShared. SimpleRemoteEPCServer::ThreadDispatcher is similarly moved and renamed to DynamicThreadPoolSimpleRemoteEPCDispatcher. This will allow these classes to be reused by SimpleRemoteEPC on the controller side of the connection.
2021-09-26[ORC][llvm-jitlink] Add debugging output to SimpleRemoteEPC (and Server).Lang Hames
Also adds an optional 'debug' argument to the llvm-jitlink-executor tool to enable debug-logging.
2021-09-23[ORC] Rename ExecutorAddress to ExecutorAddr.Lang Hames
Removing the 'ess' suffix improves the ergonomics without sacrificing clarity. Since this class is likely to be used more frequently in the future it's worth some short term pain to fix this now.
2021-09-23[ORC] Introduce EPCGenericDylibManager / SimpleExecutorDylibManager.Lang Hames
EPCGenericDylibManager provides an interface for loading dylibs and looking up symbols in the executor, implemented using EPC-calls to functions in the executor. SimpleExecutorDylibManager is an executor-side service that provides the functions used by EPCGenericDylibManager. SimpleRemoteEPC is updated to use an EPCGenericDylibManager instance to implement the ExecutorProcessControl loadDylib and lookup methods. In a future commit these methods will be removed, and clients updated to use EPCGenericDylibManagers directly.
2021-09-23[ORC] Shut down services in SimpleRemoteEPCServer.Lang Hames
This should have been included with ExecutorBootstrapService in 78b083dbb72, but was accidentally left out. It give services a chance to release any resources that they have acquired.
2021-09-17[ORC] Add finalization & deallocation actions, SimpleExecutorMemoryManager classLang Hames
Finalization and deallocation actions are a key part of the upcoming JITLinkMemoryManager redesign: They generalize the existing finalization and deallocate concepts (basically "copy-and-mprotect", and "munmap") to include support for arbitrary registration and deregistration of parts of JIT linked code. This allows us to register and deregister eh-frames, TLV sections, language metadata, etc. using regular memory management calls with no additional IPC/RPC overhead, which should both improve JIT performance and simplify interactions between ORC and the ORC runtime. The SimpleExecutorMemoryManager class provides executor-side support for memory management operations, including finalization and deallocation actions. This support is being added in advance of the rest of the memory manager redesign as it will simplify the introduction of an EPC based RuntimeDyld::MemoryManager (since eh-frame registration/deregistration will be expressible as actions). The new RuntimeDyld::MemoryManager will in turn allow us to remove older remote allocators that are blocking the rest of the memory manager changes.
2021-09-14[ORC] Add Shared/OrcRTBridge, and TargetProcess/OrcRTBootstrap.Lang Hames
This is a small first step towards reorganization of the ORC libraries: Declarations for types and function names (as strings) to be found in the "ORC runtime bootstrap" set are moved into OrcRTBridge.h / OrcRTBridge.cpp. The current implementation of the "ORC runtime bootstrap" functions is moved into OrcRTBootstrap.h and OrcRTBootstrap.cpp. It is likely that this code will eventually be moved into ORT-RT proper (in compiler RT). The immediate goal of this change is to make these bootstrap functions usable for clients other than SimpleRemoteEPC/SimpleRemoteEPCServer. The first planned client is a new RuntimeDyld::MemoryManager that will run over EPC, which will allow us to remove the old OrcRemoteTarget code.
2021-09-12[ORC] Fix out-of-range comparison errors.Lang Hames
2021-09-12Re-apply bb27e456435 and 5629afea910 with fixes.Lang Hames
This reapplies bb27e4564355243e479cab40885d6e0f7f640572 (SimpleRemoteEPC support) and 2269a941a450a0d395161cfb792be58870b2875b (#include <mutex> fix) with further fixes to support building with LLVM_ENABLE_THREADS=Off.
2021-09-11Revert 5629afea910 and bb27e456435 while I look into bot failures.Lang Hames
This reverts commit 5629afea9109d3b72064cbe70e1ca91ffb9dc0a2 ("[ORC] Add missing include."), and bb27e4564355243e479cab40885d6e0f7f640572 ("[ORC] Add SimpleRemoteEPC: ExecutorProcessControl over SPS + abstract transport."). The SimpleRemoteEPC patch currently assumes availability of threads, and needs to be rewritten with LLVM_ENABLE_THREADS guards.
2021-09-11[ORC] Add SimpleRemoteEPC: ExecutorProcessControl over SPS + abstract transport.Lang Hames
SimpleRemoteEPC is an ExecutorProcessControl implementation (with corresponding new server class) that uses ORC SimplePackedSerialization (SPS) to serialize and deserialize EPC-messages to/from byte-buffers. The byte-buffers are sent and received via a new SimpleRemoteEPCTransport interface that can be implemented to run SimpleRemoteEPC over whatever underlying transport system (IPC, RPC, network sockets, etc.) best suits your use case. The SimpleRemoteEPCServer class provides executor-side support. It uses a customizable SimpleRemoteEPCServer::Dispatcher object to dispatch wrapper function calls to prevent the RPC thread from being blocked (a problem in some earlier remote-JIT server implementations). Almost all functionality (beyond the bare basics needed to bootstrap) is implemented as wrapper functions to keep the implementation simple and uniform. Compared to previous remote JIT utilities (OrcRemoteTarget*, OrcRPCExecutorProcessControl), more consideration has been given to disconnection and error handling behavior: Graceful disconnection is now always initiated by the ORC side of the connection, and failure at either end (or in the transport) will result in Errors being delivered to both ends to enable controlled tear-down of the JIT and Executor (in the Executor's case this means "as controlled as the JIT'd code allows"). The introduction of SimpleRemoteEPC will allow us to remove other remote-JIT support from ORC (including the legacy OrcRemoteTarget* code used by lli, and the OrcRPCExecutorProcessControl and OrcRPCEPCServer classes), and then remove ORC RPC itself. The llvm-jitlink and llvm-jitlink-executor tools have been updated to use SimpleRemoteEPC over file descriptors. Future commits will move lli and other tools and example code to this system, and remove ORC RPC.