[all-commits] [llvm/llvm-project] 8a0b35: [ORC] Replace JIT-dispatch handlers with call-cont...
Lang Hames via All-commits
all-commits at lists.llvm.org
Fri Oct 2 18:54:52 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8a0b352d3ef8c5c00fc71869c9b71c9903e7db9a
https://github.com/llvm/llvm-project/commit/8a0b352d3ef8c5c00fc71869c9b71c9903e7db9a
Author: Lang Hames <lhames at gmail.com>
Date: 2026-10-03 (Sat, 03 Oct 2026)
Changed paths:
A llvm/include/llvm/ExecutionEngine/Orc/BindCallControllerHandlerSPS.h
M llvm/include/llvm/ExecutionEngine/Orc/Core.h
M llvm/lib/ExecutionEngine/Orc/COFFPlatform.cpp
M llvm/lib/ExecutionEngine/Orc/Core.cpp
M llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
M llvm/lib/ExecutionEngine/Orc/InProcessEPC.cpp
M llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp
M llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
M llvm/lib/ExecutionEngine/Orc/ReOptimizeLayer.cpp
M llvm/lib/ExecutionEngine/Orc/SelfExecutorProcessControl.cpp
M llvm/lib/ExecutionEngine/Orc/SimpleRemoteEPC.cpp
M llvm/unittests/ExecutionEngine/Orc/ExecutionSessionWrapperFunctionCallsTest.cpp
M llvm/unittests/ExecutionEngine/Orc/InProcessEPCTest.cpp
M llvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp
Log Message:
-----------
[ORC] Replace JIT-dispatch handlers with call-controller handlers (#228628)
This is the executor-to-controller counterpart to Proxy: where Proxy
provides a uniform way to call functions in the executor,
call-controller handlers provide a uniform way for the executor to call
handlers in the controller.
Handlers are now registered as CallControllerHandlerBindings, which
decouples ExecutionSession's handler registration from
SimplePackedSerialization. The new bindCallControllerHandlerSPS utility
makes it easy to introduce a new SPS handler with a one-liner, using
either a lambda:
ES.registerCallControllerHandlers(
JD, bindCallControllerHandlerSPS<int32_t(int32_t, int32_t)>(
SymbolNameSpec::c("add_tag"),
[](unique_function<void(int32_t)> Return,
int32_t X, int32_t Y) {
Return(X + Y);
}));
or a method:
ES.registerCallControllerHandlers(
JD, bindCallControllerHandlerSPS<SPSError(SPSExecutorAddr)>(
SymbolNameSpec::c("foo_tag"), &FooInstance, &Foo::func));
Tag names are expressed as SymbolNameSpecs, so callers no longer need to
pre-mangle or intern them.
This replaces ExecutionSession's JIT-dispatch handler API
(JITDispatchHandlerAssociationMap, wrapAsyncWithSPS,
registerJITDispatchHandlers, runJITDispatchHandler) with:
- CallControllerHandlerBinding, which associates a tag name and
SymbolLookupFlags with a CallControllerHandlerFn.
- registerCallControllerHandlers, which takes a std::vector of bindings,
plus a variadic convenience overload so that bindings can be constructed
inline at the call site.
- bindCallControllerHandlerSPS (in the new
BindCallControllerHandlerSPS.h header), which replaces wrapAsyncWithSPS.
- runCallControllerHandler, which replaces runJITDispatchHandler.
Handlers now receive their argument bytes as a WrapperFunctionBuffer.
Tags are now looked up using each binding's lookup flags, which default
to RequiredSymbol. Previously all tags were looked up as weakly
referenced, and handlers for missing tags were silently dropped. A
missing tag is now an error unless its binding is weakly referenced.
Since SymbolNameSpec takes care of mangling, MachOPlatform no longer
needs the "__orc_rt_resolve_tag" -> "___orc_rt_resolve_tag" alias in
standardLazyCompilationAliases, and it has been removed.
All in-tree clients have been updated. JITLinkLazyReexportsTest.Basics
now defines __orc_rt_resolve_tag, which it previously relied on the weak
lookup to tolerate. New unit tests cover tag mangling, missing required
and weak tags, duplicate bindings, and already-registered tags.
Assisted-by: Claude
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list