[all-commits] [llvm/llvm-project] 421b1f: [Libomptarget] Do not use retaining attributes for...

Joseph Huber via All-commits all-commits at lists.llvm.org
Tue Jun 7 09:16:52 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 421b1f55c6e21ab7eadc7737c1757b06577f1d71
      https://github.com/llvm/llvm-project/commit/421b1f55c6e21ab7eadc7737c1757b06577f1d71
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-06-07 (Tue, 07 Jun 2022)

  Changed paths:
    M openmp/libomptarget/DeviceRTL/CMakeLists.txt
    M openmp/libomptarget/DeviceRTL/include/Types.h
    M openmp/libomptarget/DeviceRTL/src/Mapping.cpp
    M openmp/libomptarget/DeviceRTL/src/Utils.cpp

  Log Message:
  -----------
  [Libomptarget] Do not use retaining attributes for the static library

When we build the libomptarget device runtime library targeting bitcode,
we need special care to make sure that certain functions are not
optimized out. This is because we manually internalize and optimize
these definitions, ignoring their standard linkage semantics. When we
build with the static library, we can maintain these semantics and we do
not need these to be kept-alive. Furthermore, if they are kept-alive it
prevents them from being removed during LTO. This prevents us from
completely internalizing `IsSPMDMode` and removing several other
functions. This patch removes these for the static library target by
using a macro definition to enable them.

Reviewed By: JonChesterfield

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




More information about the All-commits mailing list