[all-commits] [llvm/llvm-project] 3da61d: [OpenMP] Define omp_is_initial_device() variants i...

Hansang Bae via All-commits all-commits at lists.llvm.org
Tue Apr 6 14:58:36 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3da61ddae7fe77f71b89ce20cf6b5febd68d216a
      https://github.com/llvm/llvm-project/commit/3da61ddae7fe77f71b89ce20cf6b5febd68d216a
  Author: Hansang Bae <hansang.bae at intel.com>
  Date:   2021-04-06 (Tue, 06 Apr 2021)

  Changed paths:
    M clang/include/clang/Basic/Builtins.def
    M clang/lib/AST/ExprConstant.cpp
    R clang/test/OpenMP/is_initial_device.c
    A openmp/libomptarget/test/api/is_initial_device.c
    M openmp/runtime/src/include/omp.h.var

  Log Message:
  -----------
  [OpenMP] Define omp_is_initial_device() variants in omp.h

omp_is_initial_device() is marked as a built-in function in the current
compiler, and user code guarded by this call may be optimized away,
resulting in undesired behavior in some cases. This patch provides a
possible fix for such cases by defining the routine as a variant
function and removing it from builtin list.

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




More information about the All-commits mailing list