[all-commits] [llvm/llvm-project] dcb83b: [OpenMP] Mark device RTL variables as hidden

Joseph Huber via All-commits all-commits at lists.llvm.org
Tue Jan 18 09:53:38 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dcb83b236421d5a4d6e767ee43ae1cdab5fce0f2
      https://github.com/llvm/llvm-project/commit/dcb83b236421d5a4d6e767ee43ae1cdab5fce0f2
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M clang/test/OpenMP/target_globals_codegen.cpp
    M llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

  Log Message:
  -----------
  [OpenMP] Mark device RTL variables as hidden

This patch changes the visibility of the `__omp_rtl_debug_kind` variable
to be hidden. These variables are only used by the plugin so they do not
need to be read externally. Previously the default visibility prevented
these variables from being completely eliminated in the module.

Reviewed By: tianshilei1992

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


  Commit: d081bfcd17c1c704776a0964d239f19f6acde93d
      https://github.com/llvm/llvm-project/commit/d081bfcd17c1c704776a0964d239f19f6acde93d
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M clang/lib/AST/Decl.cpp
    M clang/test/OpenMP/declare_target_codegen.cpp
    M clang/test/OpenMP/declare_target_only_one_side_compilation.cpp

  Log Message:
  -----------
  [OpenMP] Remove hidden visibility for declare target variables

This patch changes the visiblity of variables declared within a declare
target directive. Variable declarations within a declare target
directive need to be externally visible to the plugin for initialization
or reading. Previously this would cause runtime errors where the named
global could not be found because it was not included in the symbol
table.

Reviewed By: jdoerfert

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


  Commit: 0203ff19602d9d90e03653062dbb19cc13afa956
      https://github.com/llvm/llvm-project/commit/0203ff19602d9d90e03653062dbb19cc13afa956
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M openmp/libomptarget/DeviceRTL/include/Types.h
    M openmp/libomptarget/DeviceRTL/src/Workshare.cpp

  Log Message:
  -----------
  [Libomptarget] Fix external visibility for internal variables

After the changes in D117362 made variables declared inside of a target
declare directive visible outside the plugin, some variables inside the
runtime were given visiblity that conflicted with their address space
type. This caused problems when shared or local memory was made
externally visible. This patch fixes this issue by making these
varialbes static within the module, therefore limiting their visibility
to being internal.

Reviewed By: jdoerfert

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


Compare: https://github.com/llvm/llvm-project/compare/b634f8a663d5...0203ff19602d


More information about the All-commits mailing list