Skip to content

Conversation

@lhames
Copy link
Contributor

@lhames lhames commented Dec 23, 2025

Updates ExecutionSession::runJITDispatchHandler to take the argument buffer for the function as a WrapperFunctionBuffer, rather than an ArrayRef.

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.

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.
@lhames lhames merged commit fa7f7a4 into llvm:main Dec 23, 2025
11 checks passed
@lhames lhames deleted the orc-jit-dispatch-use-wfb branch December 23, 2025 22:23
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 23, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-fast running on sanitizer-buildbot4 while building llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/18319

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 94871 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
FAIL: LLVM-Unit :: ExecutionEngine/Orc/./OrcJITTests/116/117 (75732 of 94871)
******************** TEST 'LLVM-Unit :: ExecutionEngine/Orc/./OrcJITTests/116/117' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/unittests/ExecutionEngine/Orc/./OrcJITTests-LLVM-Unit-2699842-116-117.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=117 GTEST_SHARD_INDEX=116 /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/unittests/ExecutionEngine/Orc/./OrcJITTests
--


Note: This is test shard 117 of 117.
[==========] Running 2 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 1 test from MemoryMapperTest
[ RUN      ] MemoryMapperTest.InitializeDeinitialize
[       OK ] MemoryMapperTest.InitializeDeinitialize (0 ms)
[----------] 1 test from MemoryMapperTest (1 ms total)

[----------] 1 test from ReOptimizeLayerTest
[ RUN      ] ReOptimizeLayerTest.BasicReOptimization
[       OK ] ReOptimizeLayerTest.BasicReOptimization (67 ms)
[----------] 1 test from ReOptimizeLayerTest (67 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 2 test suites ran. (122 ms total)
[  PASSED  ] 2 tests.
libc++abi: Pure virtual function called!

--
exit: -6
--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Slowest Tests:
--------------------------------------------------------------------------
282.94s: LLVM :: CodeGen/AMDGPU/sched-group-barrier-pipeline-solver.mir
213.79s: Clang :: Preprocessor/riscv-target-features.c
187.54s: Clang :: OpenMP/target_update_codegen.cpp
185.71s: LLVM :: CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
180.97s: Clang :: OpenMP/target_defaultmap_codegen_01.cpp
Step 10 (stage2/asan_ubsan check) failure: stage2/asan_ubsan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 94871 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
FAIL: LLVM-Unit :: ExecutionEngine/Orc/./OrcJITTests/116/117 (75732 of 94871)
******************** TEST 'LLVM-Unit :: ExecutionEngine/Orc/./OrcJITTests/116/117' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/unittests/ExecutionEngine/Orc/./OrcJITTests-LLVM-Unit-2699842-116-117.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=117 GTEST_SHARD_INDEX=116 /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/unittests/ExecutionEngine/Orc/./OrcJITTests
--


Note: This is test shard 117 of 117.
[==========] Running 2 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 1 test from MemoryMapperTest
[ RUN      ] MemoryMapperTest.InitializeDeinitialize
[       OK ] MemoryMapperTest.InitializeDeinitialize (0 ms)
[----------] 1 test from MemoryMapperTest (1 ms total)

[----------] 1 test from ReOptimizeLayerTest
[ RUN      ] ReOptimizeLayerTest.BasicReOptimization
[       OK ] ReOptimizeLayerTest.BasicReOptimization (67 ms)
[----------] 1 test from ReOptimizeLayerTest (67 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 2 test suites ran. (122 ms total)
[  PASSED  ] 2 tests.
libc++abi: Pure virtual function called!

--
exit: -6
--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Slowest Tests:
--------------------------------------------------------------------------
282.94s: LLVM :: CodeGen/AMDGPU/sched-group-barrier-pipeline-solver.mir
213.79s: Clang :: Preprocessor/riscv-target-features.c
187.54s: Clang :: OpenMP/target_update_codegen.cpp
185.71s: LLVM :: CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
180.97s: Clang :: OpenMP/target_defaultmap_codegen_01.cpp

@lhames
Copy link
Contributor Author

lhames commented Dec 24, 2025

PR for fix for builedbot issues: #173457

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.

2 participants