[Openmp-commits] [openmp] [OpenMP] Support up to 32 arguments in the generic microtask dispatcher (PR #211071)
via Openmp-commits
openmp-commits at lists.llvm.org
Mon Aug 3 08:55:45 PDT 2026
arsnyder16 wrote:
>convert the dispatcher to use varargs after a certain point?
That’s a fair point. My understanding is that there are two calls involved: the call into __kmp_invoke_microtask, and then its call to the compiler-generated microtask. Making the first one variadic would not necessarily help with the second, because the generated microtask has a specific signature and C++ cannot dynamically expand the argument array into that call.
The second call becomes a WebAssembly call_indirect because the runtime only has a function pointer to the generated microtask. WebAssembly checks that an indirect call’s complete signature matches the target function, including the number of parameters, so calling it with a different fixed or variadic signature can trap.
Changing the generated microtask to accept packed arguments might remove the limit, but I believe that would also require a Clang change and could affect the existing compiler/runtime convention. I may be missing another way to use varargs here, though. Would you be willing to sketch the approach you had in mind?
https://github.com/llvm/llvm-project/pull/211071
More information about the Openmp-commits
mailing list