[all-commits] [llvm/llvm-project] cb1bee: [OpenMP] libomp: fix UB when LIBOMP_NUM_HIDDEN_HEL...

Andrey Churbanov via All-commits all-commits at lists.llvm.org
Fri Feb 11 16:00:56 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cb1bee4725c475bd32df3f4ce9ba2ebe30dcf9de
      https://github.com/llvm/llvm-project/commit/cb1bee4725c475bd32df3f4ce9ba2ebe30dcf9de
  Author: AndreyChurbanov <andrey.churbanov at intel.com>
  Date:   2022-02-12 (Sat, 12 Feb 2022)

  Changed paths:
    M openmp/runtime/src/kmp_settings.cpp
    A openmp/runtime/test/tasking/hidden_helper_task/single_helper_thread.c

  Log Message:
  -----------
  [OpenMP] libomp: fix UB when LIBOMP_NUM_HIDDEN_HELPER_THREADS=1.

The __kmp_hidden_helper_threads_num set to N+1 if user requested N threads.
Thus number of worker hidden helper threads corresponds to user request,
main thread of helper team excluded as it does not participate in actual work.
This also fixes divide-by-0 issue in the code.

Fixes #48656

Differential Revision: https://reviews.llvm.org/D119586




More information about the All-commits mailing list