[Openmp-commits] [llvm] [openmp] [OpenMPOpt] Analyse loop-runtime callbacks, bound specialization, ask the runtime for the worker count (PR #219323)
Larry Meadows via Openmp-commits
openmp-commits at lists.llvm.org
Sat Aug 29 09:11:10 PDT 2026
================
@@ -1215,6 +1217,50 @@ __OMP_PROC_BIND_KIND(unknown, 7)
///}
+/// Which argument of a runtime function is a callback, and what the callback
+/// receives, in the encoding !callback metadata uses: the argument number the
+/// callee is passed in, then one entry per callback parameter giving the
+/// argument of the runtime call it is forwarded from, with -1 for a parameter
+/// the runtime supplies itself.
+///
+///{
+
+#ifndef OMP_RTL_CB_INFO
+#define OMP_RTL_CB_INFO(Enum, Str, ArgNo, ArgIndices, IsVarArg)
+#endif
+
+#define __OMP_RTL_CB_INFO(Name, ArgNo, ArgIndices, IsVarArg) \
+ OMP_RTL_CB_INFO(OMPRTL_##Name, #Name, ArgNo, ArgIndices, IsVarArg)
+
+#define __OMP_LOOP_CB_INDICES ArrayRef<int>({-1, -1})
+
----------------
lfmeadow wrote:
Right, and the header comment above the table says the entries are the argument each callback parameter is forwarded from, so `{-1, -1}` was inaccurate as well as blind. All twelve loop entry points take `(loc, fn, arg, num_iters, ...)` and call the body as `fn(i, arg)`, so the mapping is now `{-1, 2}`. `llvm/test/Transforms/OpenMP` passes with the metadata regenerated.
https://github.com/llvm/llvm-project/pull/219323
More information about the Openmp-commits
mailing list