summaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.cpp
AgeCommit message (Collapse)Author
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-03-18Re-apply "[JITLink][ORC] Rename MemDeallocPolicy to MemLifetime..." with fixes.Lang Hames
This reapplies 2cc64df0bd6a802eab592dbc282463c3e4a4281c, which was reverted in 5379c46d490640bfa80283e00240b6f1006092b4 due to bot failures. The new patch contains fixes to ELFLinkGraphBuilder.h to better handle non-SHT_ALLOC sections (these were being accidentally skipped in the previous patch), and to skip SHT_NULL sections.
2023-03-17Revert "[JITLink][ORC] Rename MemDeallocPolicy to MemLifetimePolicy, add ..."Lang Hames
This reverts commit 2cc64df0bd6a802eab592dbc282463c3e4a4281c while I investigate bot failures (e.g. https://lab.llvm.org/buildbot/#/builders/3/builds/23081).
2023-03-17[JITLink][ORC] Rename MemDeallocPolicy to MemLifetimePolicy, add NoAlloc option.Lang Hames
The original MemDeallocPolicy had two options: * Standard: allocated memory lives until deallocated or abandoned. * Finalize: allocated memory lives until all finalize actions have been run, then is destroyed. This patch introduces a new 'NoAlloc' option. NoAlloc indicates that the section should be ignored by the JITLinkMemoryManager -- the memory manager should allocate neither working memory nor executor address space to blocks in NoAlloc sections. The NoAlloc option is intended to support metadata sections (e.g. debug info) that we want to keep in the graph and have fixed up if necessary, but don't want allocated or transmitted to the executor (or we want that allocation and transmission to be managed manually by plugins). Since NoAlloc blocks are ignored by the JITLinkMemoryManager they will not have working memory allocated to them by default post-allocation. Clients wishing to modify the content of a block in a NoAlloc section should call `Block::getMutableMemory(LinkGraph&)` to get writable memory allocated on the LinkGraph's allocator (this memory will exist for the lifetime of the graph). If no client requests mutable memory prior to the fixup phase then the generic link algorithm will do so when it encounters the first edge in any given block. Addresses of blocks in NoAlloc sections are initialized by the LinkGraph creator (a LinkGraphBuilder, if the graph is generated from an object file), and should not be modified by the JITLinkMemoryManager. Plugins are responsible for updating addresses if they add/remove content from these sections. The meaning of addresses in NoAlloc-sections is backend/plugin defined, but for fixup purposes they will be treated the same as addresses in Standard/Finalize sections. References from Standard/Finalize sections to NoAlloc sections are expected to be common (these represent metadata tracking executor addresses). References from NoAlloc sections to Standard/Finalize sections are expected to be rare/non-existent (they would represent JIT'd code / data tracking metadata in the controller, which would be surprising). LinkGraphBuilders and specific backends may impose additional constraints on edges between Standard/Finalize and NoAlloc sections where required for correctness. Differential Revision: https://reviews.llvm.org/D146183
2022-12-16[Alignment] Use Align in SectionRef::getAlignment()Guillaume Chatelet
Differential Revision: https://reviews.llvm.org/D139110
2022-10-03[ORC][JITLink] Move MemoryFlags.h (MemProt, AllocGroup,...) from JITLink to ORC.Lang Hames
Moving these types to OrcShared eliminates the need for the separate WireProtectionFlags type.
2022-01-08[ORC][JITLink] Merge JITLink AllocActionCall and ORC WrapperFunctionCall.Lang Hames
These types performed identical roles. Merging them simplifies interoperability between JITLink and ORC APIs (allowing us to address a few FIXMEs).
2021-10-28Reapply e32b1eee6aa "[ORC] Change SPSExecutorAddr serialization,..." with fixes.Lang Hames
This re-applies e32b1eee6aab52e2b7b75ee15e506b3e7dd30e68, which was reverted in 20675d8f7dab293172266fdde426c2173b5b3997 due to broken unit tests. This patch includes fixes for the tests.
2021-10-27Revert "[ORC] Change SPSExecutorAddr serialization, SupportFunctionCall struct."Lang Hames
This reverts commit e32b1eee6aab52e2b7b75ee15e506b3e7dd30e68. Reverting while I fix some broken unit tests.
2021-10-27[ORC] Change SPSExecutorAddr serialization, SupportFunctionCall struct.Lang Hames
SPSExecutorAddr will now be serializable to/from ExecutorAddr, rather than uint64_t. This improves type safety when working with serialized addresses. Also updates the SupportFunctionCall to use an ExecutorAddrRange (rather than a separate ExecutorAddr addr and uint64_t size field), and updates the tpctypes::*Write data structures to use ExecutorAddr rather than JITTargetAddress.
2021-09-27[ORC] Switch from JITTargetAddress to ExecutorAddr for EPC-call APIs.Lang Hames
Part of the ongoing move to ExecutorAddr.
2021-09-27Reintroduce "[ORC] Introduce EPCGenericRTDyldMemoryManager."Lang Hames
This reintroduces "[ORC] Introduce EPCGenericRTDyldMemoryManager." (bef55a2b47a938ef35cbd7b61a1e5fa74e68c9ed) and "[lli] Add ChildTarget dependence on OrcTargetProcess library." (7a219d801bf2c3006482cf3cbd3170b3b4ea2e1b) which were reverted in 99951a56842d8e4cd0706cd17a04f77b5d0f6dd0 due to bot failures. The root cause of the bot failures should be fixed by "[ORC] Fix uninitialized variable." (0371049277912afc201da721fa659ecef7ab7fba) and "[ORC] Wait for handleDisconnect to complete in SimpleRemoteEPC::disconnect." (320832cc9b7e7fea5fc8afbed75c34c4a43287ba).
2021-09-25Revert "[ORC] Introduce EPCGenericRTDyldMemoryManager."Lang Hames
This reverts commit bef55a2b47a938ef35cbd7b61a1e5fa74e68c9ed while I investigate failures on some bots. Also reverts "[lli] Add ChildTarget dependence on OrcTargetProcess library." (7a219d801bf2c3006482cf3cbd3170b3b4ea2e1b) which was a fallow-up to bef55a2b47a.
2021-09-25[ORC] Introduce EPCGenericRTDyldMemoryManager.Lang Hames
EPCGenericRTDyldMemoryMnaager is an EPC-based implementation of the RuntimeDyld::MemoryManager interface. It enables remote-JITing via EPC (backed by a SimpleExecutorMemoryManager instance on the executor side) for RuntimeDyld clients. The lli and lli-child-target tools are updated to use SimpleRemoteEPC and SimpleRemoteEPCServer (rather than OrcRemoteTargetClient/Server), and EPCGenericRTDyldMemoryManager for MCJIT tests. By enabling remote-JITing for MCJIT and RuntimeDyld-based ORC clients, EPCGenericRTDyldMemoryManager allows us to deprecate older remote-JITing support, including OrcTargetClient/Server, OrcRPCExecutorProcessControl, and the Orc RPC system itself. These will be removed in future patches.