GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
gcc/openmp

Pass iteration count to static worksharing builtins for OMPT

OpenMP static worksharing builtins now receive loop iteration count for future OMPT integration.

This commit modifies OpenMP’s static worksharing builtins to accept the total number of loop iterations as a new argument, niter. While niter is currently unused, this change prepares the compiler for forthcoming integration with the OpenMP Tools Interface (OMPT) by ensuring the iteration count is available when the worksharing constructs are expanded.

In Details

The GOMP_loop_static_worksharing, GOMP_loop_static_worksharing_start, GOMP_distribute_static_worksharing, and GOMP_distribute_static_worksharing_start builtins have been updated to include a long niter parameter. In omp-expand.cc, the calls to these builtins are moved after the loop iteration count is computed, allowing this count to be passed. This lays the groundwork for OMPT instrumentation, which may utilize the iteration count for runtime analysis and control.

For Context
OpenMP
An API for shared-memory multiprocessing programming that supports a common, scalable model of shared-memory and mandated memory consistency models.
OMPT
OpenMP Tools Interface, a standard interface for developing tools that interact with and profile OpenMP applications at runtime.
static worksharing
A type of loop parallelization in OpenMP where iterations are divided among threads statically before execution begins, typically in chunks.
builtins
Special functions recognized by the compiler that perform specific, often low-level or optimized, operations.
niter
An argument representing the total number of iterations in a loop, added to OpenMP worksharing builtins in this commit.
Filed Under: openmpOMPTcompiler internalsruntime