Skip to content

Conversation

lhames
Copy link
Contributor

@lhames lhames commented Oct 12, 2025

In an ORC JIT it's common for multiple memory regions to be deallocated at once, e.g. when a ResourceTracker covering multiple object files is removed. This commit adds SimpleNativeMemoryMap::deallocateMultiple and SimpleNativeMemoryMap::releaseMultiple APIs that can be used to reduce the number of calls (and consequently IPC messages in cross-process setups) in these cases.

Adding these operations will make it easier to write an llvm::orc::MemoryMapper class that can use SimpleNativeMemoryMap as a backend.

In an ORC JIT it's common for multiple memory regions to be deallocated at
once, e.g. when a ResourceTracker covering multiple object files is removed.
This commit adds SimpleNativeMemoryMap::deallocateMultiple and
SimpleNativeMemoryMap::releaseMultiple APIs that can be used to reduce the
number of calls (and consequently IPC messages in cross-process setups) in
these cases.

Adding these operations will make it easier to write an llvm::orc::MemoryMapper
class that can use SimpleNativeMemoryMap as a backend.
@lhames lhames merged commit d4a4137 into llvm:main Oct 12, 2025
11 checks passed
@lhames lhames deleted the orc-rt-snmm-multi-dealloc branch October 12, 2025 01:03
DharuniRAcharya pushed a commit to DharuniRAcharya/llvm-project that referenced this pull request Oct 13, 2025
…vm#163025)

In an ORC JIT it's common for multiple memory regions to be deallocated
at once, e.g. when a ResourceTracker covering multiple object files is
removed. This commit adds SimpleNativeMemoryMap::deallocateMultiple and
SimpleNativeMemoryMap::releaseMultiple APIs that can be used to reduce
the number of calls (and consequently IPC messages in cross-process
setups) in these cases.

Adding these operations will make it easier to write an
llvm::orc::MemoryMapper class that can use SimpleNativeMemoryMap as a
backend.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant