[all-commits] [llvm/llvm-project] e2dcc2: [Libomptarget] Work around bug in initialization o...

Joseph Huber via All-commits all-commits at lists.llvm.org
Fri Mar 4 10:13:57 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e2dcc2218c64ae1b6a774f52bd3aec87a6902b58
      https://github.com/llvm/llvm-project/commit/e2dcc2218c64ae1b6a774f52bd3aec87a6902b58
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-03-04 (Fri, 04 Mar 2022)

  Changed paths:
    M openmp/libomptarget/DeviceRTL/src/Mapping.cpp

  Log Message:
  -----------
  [Libomptarget] Work around bug in initialization of libomptarget

Libomptarget uses some shared variables to track certain internal stated
in the runtime. This causes problems when we have code that contains no
OpenMP kernels. These variables are normally initialized upon kernel
entry, but if there are no kernels we will see no initialization.
Currently we load the runtime into each source file when not running in
LTO mode, so these variables will be erroneously considered undefined or
dead and removed, causing miscompiles. This patch temporarily works
around the most obvious case, but others still exhibit this problem. We
will need to fix this more soundly later.

Fixes #54208.

Reviewed By: jdoerfert

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




More information about the All-commits mailing list