Skip to content

Commit

Permalink
[ORC] Run incoming jit-dispatch calls via the TaskDispatcher in Simpl…
Browse files Browse the repository at this point in the history
…eRemoteEPC.

Handlers for jit-dispatch calls are allowed to make their own EPC calls, so we
don't want to run these on the handler thread.
  • Loading branch information
lhames committed Nov 1, 2021
1 parent ac65366 commit e9014d9
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions llvm/lib/ExecutionEngine/Orc/SimpleRemoteEPC.cpp
Expand Up @@ -374,13 +374,18 @@ void SimpleRemoteEPC::handleCallWrapper(
uint64_t RemoteSeqNo, ExecutorAddr TagAddr,
SimpleRemoteEPCArgBytesVector ArgBytes) {
assert(ES && "No ExecutionSession attached");
ES->runJITDispatchHandler(
[this, RemoteSeqNo](shared::WrapperFunctionResult WFR) {
if (auto Err = sendMessage(SimpleRemoteEPCOpcode::Result, RemoteSeqNo,
ExecutorAddr(), {WFR.data(), WFR.size()}))
getExecutionSession().reportError(std::move(Err));
D->dispatch(makeGenericNamedTask(
[this, RemoteSeqNo, TagAddr, ArgBytes = std::move(ArgBytes)]() {
ES->runJITDispatchHandler(
[this, RemoteSeqNo](shared::WrapperFunctionResult WFR) {
if (auto Err =
sendMessage(SimpleRemoteEPCOpcode::Result, RemoteSeqNo,
ExecutorAddr(), {WFR.data(), WFR.size()}))
getExecutionSession().reportError(std::move(Err));
},
TagAddr.getValue(), ArgBytes);
},
TagAddr.getValue(), ArgBytes);
"callWrapper task"));
}

Error SimpleRemoteEPC::handleHangup(SimpleRemoteEPCArgBytesVector ArgBytes) {
Expand Down

0 comments on commit e9014d9

Please sign in to comment.