[clang] [llvm] [openmp] [OpenMP][clang] 6.0: codegen+runtime for num_threads strict (PR #146346)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 30 08:14:27 PDT 2025


================
@@ -1214,6 +1214,12 @@ void __kmp_serialized_parallel(ident_t *loc, kmp_int32 global_tid) {
   // Reset for next parallel region
   this_thr->th.th_set_proc_bind = proc_bind_default;
 
+  // OpenMP 6.0 12.1.2 requires the num_threads 'strict' modifier to also have
+  // effect when parallel execution is disabled by a corresponding if clause
+  // attached to the parallel directive.
+  if (this_thr->th.th_nt_strict && this_thr->th.th_set_nproc > 1)
----------------
ro-i wrote:

e.g. by `__kmp_set_strict_num_threads`, which is called by `__kmpc_push_num_threads_strict`, see https://github.com/llvm/llvm-project/pull/85466 

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


More information about the llvm-commits mailing list