[all-commits] [llvm/llvm-project] bb27e4: [ORC] Add SimpleRemoteEPC: ExecutorProcessControl ...

lhames via All-commits all-commits at lists.llvm.org
Sat Sep 11 01:19:57 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bb27e4564355243e479cab40885d6e0f7f640572
      https://github.com/llvm/llvm-project/commit/bb27e4564355243e479cab40885d6e0f7f640572
  Author: Lang Hames <lhames at gmail.com>
  Date:   2021-09-11 (Sat, 11 Sep 2021)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/Orc/Core.h
    M llvm/include/llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h
    M llvm/include/llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h
    A llvm/include/llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h
    A llvm/include/llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h
    A llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h
    M llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
    M llvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp
    R llvm/lib/ExecutionEngine/Orc/EPCGenericMemoryAccess.cpp
    M llvm/lib/ExecutionEngine/Orc/Shared/CMakeLists.txt
    A llvm/lib/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.cpp
    A llvm/lib/ExecutionEngine/Orc/SimpleRemoteEPC.cpp
    M llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
    A llvm/lib/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.cpp
    M llvm/tools/llvm-jitlink/llvm-jitlink-executor/llvm-jitlink-executor.cpp
    M llvm/tools/llvm-jitlink/llvm-jitlink.cpp
    M llvm/tools/llvm-jitlink/llvm-jitlink.h

  Log Message:
  -----------
  [ORC] Add SimpleRemoteEPC: ExecutorProcessControl over SPS + abstract transport.

SimpleRemoteEPC is an ExecutorProcessControl implementation (with corresponding
new server class) that uses ORC SimplePackedSerialization (SPS) to serialize and
deserialize EPC-messages to/from byte-buffers. The byte-buffers are sent and
received via a new SimpleRemoteEPCTransport interface that can be implemented to
run SimpleRemoteEPC over whatever underlying transport system (IPC, RPC, network
sockets, etc.) best suits your use case.

The SimpleRemoteEPCServer class provides executor-side support. It uses a
customizable SimpleRemoteEPCServer::Dispatcher object to dispatch wrapper
function calls to prevent the RPC thread from being blocked (a problem in some
earlier remote-JIT server implementations). Almost all functionality (beyond the
bare basics needed to bootstrap) is implemented as wrapper functions to keep the
implementation simple and uniform.

Compared to previous remote JIT utilities (OrcRemoteTarget*,
OrcRPCExecutorProcessControl), more consideration has been given to
disconnection and error handling behavior: Graceful disconnection is now always
initiated by the ORC side of the connection, and failure at either end (or in
the transport) will result in Errors being delivered to both ends to enable
controlled tear-down of the JIT and Executor (in the Executor's case this means
"as controlled as the JIT'd code allows").

The introduction of SimpleRemoteEPC will allow us to remove other remote-JIT
support from ORC (including the legacy OrcRemoteTarget* code used by lli, and
the OrcRPCExecutorProcessControl and OrcRPCEPCServer classes), and then remove
ORC RPC itself.

The llvm-jitlink and llvm-jitlink-executor tools have been updated to use
SimpleRemoteEPC over file descriptors. Future commits will move lli and other
tools and example code to this system, and remove ORC RPC.




More information about the All-commits mailing list