Skip to content

Commit

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

This reverts commit 41652c6 while I investigate
more bot failures.
  • Loading branch information
lhames authored and broxigarchen committed Dec 10, 2024
1 parent ed15b74 commit a77ea61
Show file tree
Hide file tree
Showing 28 changed files with 80 additions and 835 deletions.
5 changes: 1 addition & 4 deletions compiler-rt/lib/orc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
# ORC runtime library common implementation files.
set(ORC_COMMON_SOURCES
debug.cpp
dlfcn_wrapper.cpp
extensible_rtti.cpp
log_error_to_stderr.cpp
run_program_wrapper.cpp
resolve.cpp
dlfcn_wrapper.cpp
)

# Common implementation headers will go here.
Expand Down Expand Up @@ -52,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 Down Expand Up @@ -118,7 +116,6 @@ else() # not Apple
elfnix_tls.x86-64.S
elfnix_tls.aarch64.S
elfnix_tls.ppc64.S
sysv_reentry.arm64.S
)
endif()

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
5 changes: 0 additions & 5 deletions llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,6 @@ class ELFNixPlatform : public Platform {
static ArrayRef<std::pair<const char *, const char *>>
standardRuntimeUtilityAliases();

/// Returns a list of aliases required to enable lazy compilation via the
/// ORC runtime.
static ArrayRef<std::pair<const char *, const char *>>
standardLazyCompilationAliases();

private:
// Data needed for bootstrap only.
struct BootstrapInfo {
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
Loading

0 comments on commit a77ea61

Please sign in to comment.