[PATCH] D128544: [Orc][JITLink] Add a shared memory based implementation of MemoryMapper

Anubhab Ghosh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 26 19:58:24 PDT 2022


argentite created this revision.
Herald added subscribers: hiraditya, mgorny.
Herald added a project: All.
argentite updated this revision to Diff 440035.
argentite added a comment.
argentite added reviewers: lhames, sgraenitz.
argentite published this revision for review.
Herald added subscribers: llvm-commits, StephenFan.
Herald added a project: LLVM.

Windows support and some other fixes



================
Comment at: llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp:25-48
+static DWORD getWindowsProtectionFlags(unsigned Flags) {
+  switch (Flags & llvm::sys::Memory::MF_RWE_MASK) {
+  // Contrary to what you might expect, the Windows page protection flags
+  // are not a bitwise combination of RWX values
+  case llvm::sys::Memory::MF_READ:
+    return PAGE_READONLY;
+  case llvm::sys::Memory::MF_WRITE:
----------------
This function is copied from lib/Support/Windows/Memory.inc. We probably should expose it from there instead.


This is an implementation of orc::MemoryMapper that maps shared memory
pages in both executor and controller process and writes directly to
them avoiding transferring content over EPC.
All allocations are properly deinitialized automatically on the
executor side at shutdown by the ExecutorSharedMemoryMapperService.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128544

Files:
  llvm/include/llvm/ExecutionEngine/Orc/MemoryMapper.h
  llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h
  llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h
  llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
  llvm/lib/ExecutionEngine/Orc/Shared/OrcRTBridge.cpp
  llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
  llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
  llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
  llvm/unittests/ExecutionEngine/Orc/SharedMemoryMapperTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128544.440035.patch
Type: text/x-patch
Size: 33343 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220627/39ae0411/attachment.bin>


More information about the llvm-commits mailing list