LLVM  14.0.0git
EPCGenericJITLinkMemoryManager.h
Go to the documentation of this file.
1 //===- EPCGenericJITLinkMemoryManager.h - EPC-based mem manager -*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Implements JITLinkMemoryManager by making remove calls via
10 // ExecutorProcessControl::callWrapperAsync.
11 //
12 // This simplifies the implementaton of new ExecutorProcessControl instances,
13 // as this implementation will always work (at the cost of some performance
14 // overhead for the calls).
15 //
16 //===----------------------------------------------------------------------===//
17 
18 #ifndef LLVM_EXECUTIONENGINE_ORC_EPCGENERICJITLINKMEMORYMANAGER_H
19 #define LLVM_EXECUTIONENGINE_ORC_EPCGENERICJITLINKMEMORYMANAGER_H
20 
23 
24 namespace llvm {
25 namespace orc {
26 
28 public:
29  /// Function addresses for memory access.
30  struct SymbolAddrs {
35  };
36 
37  /// Create an EPCGenericJITLinkMemoryManager instance from a given set of
38  /// function addrs.
40  : EPC(EPC), SAs(SAs) {}
41 
43  OnAllocatedFunction OnAllocated) override;
44 
45  // Use overloads from base class.
46  using JITLinkMemoryManager::allocate;
47 
48  void deallocate(std::vector<FinalizedAlloc> Allocs,
49  OnDeallocatedFunction OnDeallocated) override;
50 
51  // Use overloads from base class.
52  using JITLinkMemoryManager::deallocate;
53 
54 private:
55  class InFlightAlloc;
56 
57  void completeAllocation(ExecutorAddr AllocAddr, jitlink::BasicLayout BL,
58  OnAllocatedFunction OnAllocated);
59 
61  SymbolAddrs SAs;
62 };
63 
64 namespace shared {
65 
66 /// FIXME: This specialization should be moved into TargetProcessControlTypes.h
67 /// (or whereever those types get merged to) once ORC depends on JITLink.
68 template <>
70  jitlink::JITLinkMemoryManager::FinalizedAlloc> {
71 public:
74  }
75 
76  static bool
80  OB, ExecutorAddr(FA.getAddress()));
81  }
82 
83  static bool deserialize(SPSInputBuffer &IB,
85  ExecutorAddr A;
87  return false;
89  return true;
90  }
91 };
92 
93 } // end namespace shared
94 } // end namespace orc
95 } // end namespace llvm
96 
97 #endif // LLVM_EXECUTIONENGINE_ORC_EPCGENERICJITLINKMEMORYMANAGER_H
llvm::orc::ExecutorAddr
Represents an address in the executor process.
Definition: ExecutorAddress.h:37
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::orc::shared::SPSSerializationTraits
Specialize to describe how to serialize/deserialize to/from the given concrete type.
Definition: SimplePackedSerialization.h:103
llvm::orc::EPCGenericJITLinkMemoryManager::SymbolAddrs
Function addresses for memory access.
Definition: EPCGenericJITLinkMemoryManager.h:30
llvm::orc::shared::SPSOutputBuffer
Output char buffer with overflow check.
Definition: SimplePackedSerialization.h:53
llvm::orc::ExecutorProcessControl
ExecutorProcessControl supports interaction with a JIT target process.
Definition: ExecutorProcessControl.h:38
llvm::orc::shared::SPSInputBuffer
Input char buffer with underflow check.
Definition: SimplePackedSerialization.h:72
llvm::ARCISD::BL
@ BL
Definition: ARCISelLowering.h:34
llvm::orc::EPCGenericJITLinkMemoryManager::EPCGenericJITLinkMemoryManager
EPCGenericJITLinkMemoryManager(ExecutorProcessControl &EPC, SymbolAddrs SAs)
Create an EPCGenericJITLinkMemoryManager instance from a given set of function addrs.
Definition: EPCGenericJITLinkMemoryManager.h:39
llvm::orc::EPCGenericJITLinkMemoryManager
Definition: EPCGenericJITLinkMemoryManager.h:27
llvm::orc::EPCGenericJITLinkMemoryManager::deallocate
void deallocate(std::vector< FinalizedAlloc > Allocs, OnDeallocatedFunction OnDeallocated) override
Deallocate a list of allocation objects.
Definition: EPCGenericJITLinkMemoryManager.cpp:136
llvm::orc::shared::SPSExecutorAddr
Definition: ExecutorAddress.h:163
llvm::orc::EPCGenericJITLinkMemoryManager::allocate
void allocate(const jitlink::JITLinkDylib *JD, jitlink::LinkGraph &G, OnAllocatedFunction OnAllocated) override
Start the allocation process.
Definition: EPCGenericJITLinkMemoryManager.cpp:111
G
const DataFlowGraph & G
Definition: RDFGraph.cpp:202
size
i< reg-> size
Definition: README.txt:166
llvm::orc::EPCGenericJITLinkMemoryManager::SymbolAddrs::Allocator
ExecutorAddr Allocator
Definition: EPCGenericJITLinkMemoryManager.h:31
JITLinkMemoryManager.h
llvm::orc::EPCGenericJITLinkMemoryManager::SymbolAddrs::Finalize
ExecutorAddr Finalize
Definition: EPCGenericJITLinkMemoryManager.h:33
Core.h
llvm::orc::EPCGenericJITLinkMemoryManager::SymbolAddrs::Reserve
ExecutorAddr Reserve
Definition: EPCGenericJITLinkMemoryManager.h:32
llvm::orc::EPCGenericJITLinkMemoryManager::SymbolAddrs::Deallocate
ExecutorAddr Deallocate
Definition: EPCGenericJITLinkMemoryManager.h:34
llvm::X86II::OB
@ OB
Definition: X86BaseInfo.h:801
llvm::orc::shared::SPSArgList
A utility class for serializing to a blob from a variadic list.
Definition: SimplePackedSerialization.h:106