Skip to content

Commit

Permalink
Revert "[ORC] Introduce LazyReexportsManager, JITLinkTrampolines, … (#…
Browse files Browse the repository at this point in the history
…118923)"

This reverts commit 570ecdc while I investigate
bot failures, e.g. https://lab.llvm.org/buildbot/#/builders/17/builds/4446.
  • Loading branch information
lhames committed Dec 7, 2024
1 parent bc624a5 commit 6073dd9
Show file tree
Hide file tree
Showing 26 changed files with 75 additions and 814 deletions.
2 changes: 0 additions & 2 deletions compiler-rt/lib/orc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ if (APPLE)
set(ORC_ASM_SOURCES
macho_tlv.x86-64.S
macho_tlv.arm64.S
sysv_reentry.arm64.S
)

set(ORC_IMPL_HEADERS
Expand All @@ -62,7 +61,6 @@ if (APPLE)
set(ORC_SOURCES
${ORC_COMMON_SOURCES}
macho_platform.cpp
sysv_resolve.cpp
)

add_compiler_rt_object_libraries(RTOrc
Expand Down
102 changes: 0 additions & 102 deletions compiler-rt/lib/orc/sysv_reentry.arm64.S

This file was deleted.

49 changes: 0 additions & 49 deletions compiler-rt/lib/orc/sysv_resolve.cpp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Test that the orc-remote-executor tool errors out as expected when called
// with no arguments.
//
// RUN: not %orc_rt_executor 2>&1 | FileCheck %s

// CHECK: usage: orc-rt-executor [help] [<mode>] <program arguments>...
5 changes: 0 additions & 5 deletions compiler-rt/test/orc/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
host_arch_compatible = True
if host_arch_compatible:
config.available_features.add("host-arch-compatible")

# If the target OS hasn't been set then assume host.
if not config.target_os:
config.target_os = config.host_os

config.test_target_is_host_executable = (
config.target_os == config.host_os and host_arch_compatible
)
Expand Down
26 changes: 0 additions & 26 deletions llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -755,32 +755,6 @@ inline Symbol &createAnonymousPointerJumpStub(LinkGraph &G,
sizeof(PointerJumpStubContent), true, false);
}

/// AArch64 reentry trampoline.
///
/// Contains the instruction sequence for a trampoline that stores its return
/// address on the stack and passes its own address in x0:
/// STP x29, x30, [sp, #-16]!
/// BL <reentry-symbol>
extern const char ReentryTrampolineContent[8];

/// Create a block of N reentry trampolines.
inline Block &createReentryTrampolineBlock(LinkGraph &G,
Section &TrampolineSection,
Symbol &ReentrySymbol) {
auto &B = G.createContentBlock(TrampolineSection, ReentryTrampolineContent,
orc::ExecutorAddr(~uint64_t(7)), 4, 0);
B.addEdge(Branch26PCRel, 4, ReentrySymbol, 0);
return B;
}

inline Symbol &createAnonymousReentryTrampoline(LinkGraph &G,
Section &TrampolineSection,
Symbol &ReentrySymbol) {
return G.addAnonymousSymbol(
createReentryTrampolineBlock(G, TrampolineSection, ReentrySymbol), 0,
sizeof(ReentryTrampolineContent), true, false);
}

/// Global Offset Table Builder.
class GOTTableManager : public TableManager<GOTTableManager> {
public:
Expand Down
27 changes: 0 additions & 27 deletions llvm/include/llvm/ExecutionEngine/Orc/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,6 @@ enum class SymbolState : uint8_t;
using ResourceTrackerSP = IntrusiveRefCntPtr<ResourceTracker>;
using JITDylibSP = IntrusiveRefCntPtr<JITDylib>;

/// A definition of a Symbol within a JITDylib.
class SymbolInstance {
public:
using LookupAsyncOnCompleteFn =
unique_function<void(Expected<ExecutorSymbolDef>)>;

SymbolInstance(JITDylibSP JD, SymbolStringPtr Name)
: JD(std::move(JD)), Name(std::move(Name)) {}

const JITDylib &getJITDylib() const { return *JD; }
const SymbolStringPtr &getName() const { return Name; }

Expected<ExecutorSymbolDef> lookup() const;
void lookupAsync(LookupAsyncOnCompleteFn OnComplete) const;

private:
JITDylibSP JD;
SymbolStringPtr Name;
};

using ResourceKey = uintptr_t;

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

/// Return the ResourceTracker associated with this instance.
const ResourceTrackerSP &getResourceTracker() const { return RT; }

/// Runs the given callback under the session lock, passing in the associated
/// ResourceKey. This is the safe way to associate resources with trackers.
template <typename Func> Error withResourceKeyDo(Func &&F) const {
Expand Down Expand Up @@ -1771,10 +1748,6 @@ class ExecutionSession {
JITDispatchHandlers;
};

inline Expected<ExecutorSymbolDef> SymbolInstance::lookup() const {
return JD->getExecutionSession().lookup({JD.get()}, Name);
}

template <typename Func> Error ResourceTracker::withResourceKeyDo(Func &&F) {
return getJITDylib().getExecutionSession().runSessionLocked([&]() -> Error {
if (isDefunct())
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ class JITLinkRedirectableSymbolManager : public RedirectableSymbolManager {
ObjLinkingLayer, AnonymousPtrCreator, PtrJumpStubCreator));
}

void emitRedirectableSymbols(std::unique_ptr<MaterializationResponsibility> R,
SymbolMap InitialDests) override;

Error redirect(JITDylib &JD, const SymbolMap &NewDests) override;

private:
JITLinkRedirectableSymbolManager(
ObjectLinkingLayer &ObjLinkingLayer,
jitlink::AnonymousPointerCreator &AnonymousPtrCreator,
Expand All @@ -47,14 +53,6 @@ class JITLinkRedirectableSymbolManager : public RedirectableSymbolManager {
AnonymousPtrCreator(std::move(AnonymousPtrCreator)),
PtrJumpStubCreator(std::move(PtrJumpStubCreator)) {}

ObjectLinkingLayer &getObjectLinkingLayer() const { return ObjLinkingLayer; }

void emitRedirectableSymbols(std::unique_ptr<MaterializationResponsibility> R,
SymbolMap InitialDests) override;

Error redirect(JITDylib &JD, const SymbolMap &NewDests) override;

private:
ObjectLinkingLayer &ObjLinkingLayer;
jitlink::AnonymousPointerCreator AnonymousPtrCreator;
jitlink::PointerJumpStubCreator PtrJumpStubCreator;
Expand Down
72 changes: 0 additions & 72 deletions llvm/include/llvm/ExecutionEngine/Orc/JITLinkReentryTrampolines.h

This file was deleted.

Loading

0 comments on commit 6073dd9

Please sign in to comment.