8 Commits

Author SHA1 Message Date
Lang Hames
5be1d4b0dc
[ORC] Fix ReOptimizeLayer buggy jit-dispatch signature in fa7f7a4cab4. (#173457)
fa7f7a4cab4 changed the jit-dispatch function signature used in the
orc_rt_lite_reoptimize_helper function, but jit-dispatch still takes a
raw data pointer and size argument.

Should fix the bug in
https://lab.llvm.org/buildbot/#/builders/169/builds/18319 and similar
builds.
2025-12-24 19:15:07 +11:00
Lang Hames
fa7f7a4cab
[ORC] Pass JITDispatchHandler argument buffers as WrapperFunctionBuffer. (#173334)
Updates ExecutionSession::runJITDispatchHandler to take the argument
buffer for the function as a WrapperFunctionBuffer, rather than an
ArrayRef<char>.

This is a first step towards more efficient jit-dispatch handler calls:

1. Handlers can now be run as tasks, since they own their argument
buffer (so there's no risk of it being deallocated before they're run)
2. In in-process JIT setups, this will allow argument buffers to be
passed in directly from the ORC runtime, rather than having to copy the
buffer.
2025-12-24 09:18:38 +11:00
Lang Hames
01effcd82d
[ORC] Add, and call through, reoptimize function in ReOptimizeLayer. (#173204)
ReOptimizeLayer was building LLVM IR to define a precomputed,
SPS-serialized argument buffer, then inserting calls directly to
__orc_rt_jit_dispatch, passing the address of the precomputed buffer and
an __orc_rt_reoptimize_tag defined by the ORC runtime. This design is
non-canonical, requiring the ORC runtime to be loaded (or an extra
definition for __orc_rt_reoptimize_tag to be inserted) while not using
the runtime to perform the serialization.

This commit updates ReOptimizeLayer to instead insert calls to an
__orc_rt_reoptimize function implemented in the ORC runtime. This
function will perform serialization and call __orc_rt_jit_dispatch,
similar to other functions in the ORC runtime.

To maintain support for in-process JITs that don't use the ORC runtime,
this commit adds a ReOptimizeLayer::addOrcRTLiteSupport method which
injects IR to define __orc_rt_reoptimize (calling through to an
orc_rt_lite_reoptimize_helper function defined in LLVM) and
__orc_rt_reoptimize_tag. The ReOptimizeLayerTest is updated to use
addOrcRTLiteSupport.
2025-12-23 17:28:28 +11:00
Lang Hames
48c8c45475
[ORC] Fix typo in method name. NFCI. (#172787)
"reigsterRuntimeFunctions" should be "registerRuntimeFunctions".
2025-12-18 16:14:01 +11:00
Kazu Hirata
099a11f4ab
[ExecutionEngine] Avoid repeated hash lookups (NFC) (#131959) 2025-03-19 07:13:42 -07:00
Sunho Kim
188ede28e0 [ORC] Implement basic reoptimization. 2024-10-12 01:21:05 +09:00
Nikita Popov
47682e4b4a Revert "[ORC] Implement basic reoptimization. (#67050)"
This reverts commit 0d288e5b0ccf217e41944ad4fd8772d8ae45daa1.

Breaks the build.
2024-04-26 14:47:48 +09:00
Sunho Kim
0d288e5b0c
[ORC] Implement basic reoptimization. (#67050) 2024-04-25 22:43:06 -07:00