Skip to content

Commit 6073dd9

Browse files
committed
Revert "[ORC] Introduce LazyReexportsManager, JITLinkTrampolines, … (#118923)"
This reverts commit 570ecdc while I investigate bot failures, e.g. https://lab.llvm.org/buildbot/#/builders/17/builds/4446.
1 parent bc624a5 commit 6073dd9

26 files changed

+75
-814
lines changed

compiler-rt/lib/orc/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ if (APPLE)
5151
set(ORC_ASM_SOURCES
5252
macho_tlv.x86-64.S
5353
macho_tlv.arm64.S
54-
sysv_reentry.arm64.S
5554
)
5655

5756
set(ORC_IMPL_HEADERS
@@ -62,7 +61,6 @@ if (APPLE)
6261
set(ORC_SOURCES
6362
${ORC_COMMON_SOURCES}
6463
macho_platform.cpp
65-
sysv_resolve.cpp
6664
)
6765

6866
add_compiler_rt_object_libraries(RTOrc

compiler-rt/lib/orc/sysv_reentry.arm64.S

-102
This file was deleted.

compiler-rt/lib/orc/sysv_resolve.cpp

-49
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Test that the orc-remote-executor tool errors out as expected when called
2+
// with no arguments.
3+
//
4+
// RUN: not %orc_rt_executor 2>&1 | FileCheck %s
5+
6+
// CHECK: usage: orc-rt-executor [help] [<mode>] <program arguments>...

compiler-rt/test/orc/lit.cfg.py

-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616
host_arch_compatible = True
1717
if host_arch_compatible:
1818
config.available_features.add("host-arch-compatible")
19-
20-
# If the target OS hasn't been set then assume host.
21-
if not config.target_os:
22-
config.target_os = config.host_os
23-
2419
config.test_target_is_host_executable = (
2520
config.target_os == config.host_os and host_arch_compatible
2621
)

llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h

-26
Original file line numberDiff line numberDiff line change
@@ -755,32 +755,6 @@ inline Symbol &createAnonymousPointerJumpStub(LinkGraph &G,
755755
sizeof(PointerJumpStubContent), true, false);
756756
}
757757

758-
/// AArch64 reentry trampoline.
759-
///
760-
/// Contains the instruction sequence for a trampoline that stores its return
761-
/// address on the stack and passes its own address in x0:
762-
/// STP x29, x30, [sp, #-16]!
763-
/// BL <reentry-symbol>
764-
extern const char ReentryTrampolineContent[8];
765-
766-
/// Create a block of N reentry trampolines.
767-
inline Block &createReentryTrampolineBlock(LinkGraph &G,
768-
Section &TrampolineSection,
769-
Symbol &ReentrySymbol) {
770-
auto &B = G.createContentBlock(TrampolineSection, ReentryTrampolineContent,
771-
orc::ExecutorAddr(~uint64_t(7)), 4, 0);
772-
B.addEdge(Branch26PCRel, 4, ReentrySymbol, 0);
773-
return B;
774-
}
775-
776-
inline Symbol &createAnonymousReentryTrampoline(LinkGraph &G,
777-
Section &TrampolineSection,
778-
Symbol &ReentrySymbol) {
779-
return G.addAnonymousSymbol(
780-
createReentryTrampolineBlock(G, TrampolineSection, ReentrySymbol), 0,
781-
sizeof(ReentryTrampolineContent), true, false);
782-
}
783-
784758
/// Global Offset Table Builder.
785759
class GOTTableManager : public TableManager<GOTTableManager> {
786760
public:

llvm/include/llvm/ExecutionEngine/Orc/Core.h

-27
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,6 @@ enum class SymbolState : uint8_t;
5151
using ResourceTrackerSP = IntrusiveRefCntPtr<ResourceTracker>;
5252
using JITDylibSP = IntrusiveRefCntPtr<JITDylib>;
5353

54-
/// A definition of a Symbol within a JITDylib.
55-
class SymbolInstance {
56-
public:
57-
using LookupAsyncOnCompleteFn =
58-
unique_function<void(Expected<ExecutorSymbolDef>)>;
59-
60-
SymbolInstance(JITDylibSP JD, SymbolStringPtr Name)
61-
: JD(std::move(JD)), Name(std::move(Name)) {}
62-
63-
const JITDylib &getJITDylib() const { return *JD; }
64-
const SymbolStringPtr &getName() const { return Name; }
65-
66-
Expected<ExecutorSymbolDef> lookup() const;
67-
void lookupAsync(LookupAsyncOnCompleteFn OnComplete) const;
68-
69-
private:
70-
JITDylibSP JD;
71-
SymbolStringPtr Name;
72-
};
73-
7454
using ResourceKey = uintptr_t;
7555

7656
/// API to remove / transfer ownership of JIT resources.
@@ -570,9 +550,6 @@ class MaterializationResponsibility {
570550
/// emitted or notified of an error.
571551
~MaterializationResponsibility();
572552

573-
/// Return the ResourceTracker associated with this instance.
574-
const ResourceTrackerSP &getResourceTracker() const { return RT; }
575-
576553
/// Runs the given callback under the session lock, passing in the associated
577554
/// ResourceKey. This is the safe way to associate resources with trackers.
578555
template <typename Func> Error withResourceKeyDo(Func &&F) const {
@@ -1771,10 +1748,6 @@ class ExecutionSession {
17711748
JITDispatchHandlers;
17721749
};
17731750

1774-
inline Expected<ExecutorSymbolDef> SymbolInstance::lookup() const {
1775-
return JD->getExecutionSession().lookup({JD.get()}, Name);
1776-
}
1777-
17781751
template <typename Func> Error ResourceTracker::withResourceKeyDo(Func &&F) {
17791752
return getJITDylib().getExecutionSession().runSessionLocked([&]() -> Error {
17801753
if (isDefunct())

llvm/include/llvm/ExecutionEngine/Orc/JITLinkLazyCallThroughManager.h

-26
This file was deleted.

llvm/include/llvm/ExecutionEngine/Orc/JITLinkRedirectableSymbolManager.h

+6-8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ class JITLinkRedirectableSymbolManager : public RedirectableSymbolManager {
3939
ObjLinkingLayer, AnonymousPtrCreator, PtrJumpStubCreator));
4040
}
4141

42+
void emitRedirectableSymbols(std::unique_ptr<MaterializationResponsibility> R,
43+
SymbolMap InitialDests) override;
44+
45+
Error redirect(JITDylib &JD, const SymbolMap &NewDests) override;
46+
47+
private:
4248
JITLinkRedirectableSymbolManager(
4349
ObjectLinkingLayer &ObjLinkingLayer,
4450
jitlink::AnonymousPointerCreator &AnonymousPtrCreator,
@@ -47,14 +53,6 @@ class JITLinkRedirectableSymbolManager : public RedirectableSymbolManager {
4753
AnonymousPtrCreator(std::move(AnonymousPtrCreator)),
4854
PtrJumpStubCreator(std::move(PtrJumpStubCreator)) {}
4955

50-
ObjectLinkingLayer &getObjectLinkingLayer() const { return ObjLinkingLayer; }
51-
52-
void emitRedirectableSymbols(std::unique_ptr<MaterializationResponsibility> R,
53-
SymbolMap InitialDests) override;
54-
55-
Error redirect(JITDylib &JD, const SymbolMap &NewDests) override;
56-
57-
private:
5856
ObjectLinkingLayer &ObjLinkingLayer;
5957
jitlink::AnonymousPointerCreator AnonymousPtrCreator;
6058
jitlink::PointerJumpStubCreator PtrJumpStubCreator;

llvm/include/llvm/ExecutionEngine/Orc/JITLinkReentryTrampolines.h

-72
This file was deleted.

0 commit comments

Comments
 (0)