[clang] [llvm] [Clang][OpenMP] Implement Loop splitting `#pragma omp split` directive (PR #183261)

Michael Kruse via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 25 05:55:26 PDT 2026


================
@@ -11153,6 +11153,12 @@ def err_omp_bind_required_on_loop : Error<
   "construct">;
 def err_omp_loop_reduction_clause : Error<
   "'reduction' clause not allowed with '#pragma omp loop bind(teams)'">;
+def err_omp_split_counts_multiple_omp_fill : Error<
+  "at most one 'omp_fill' may appear in the 'counts' clause">;
+def err_omp_split_counts_omp_fill_not_last : Error<
+  "'omp_fill' must be the last item in the 'counts' clause">;
----------------
Meinersbur wrote:

Generally, the `omp_fill` can be anywhere. E.g. to split off one iteration from the front and the end:
```c
#pragma omp split counts(1,omp_fill,1)
for (int i = -1; i <= n; ++i)
```
would yield
```c
{
  for (int i = -1; i < 0; ++i)
  for (int i = 0; i < n; ++i)
  for (int i = n; i <= n; ++i)
}
```

https://github.com/llvm/llvm-project/pull/183261


More information about the cfe-commits mailing list