[all-commits] [llvm/llvm-project] 2945f1: [OpenMP] Only generate runtime flags with host input

Joseph Huber via All-commits all-commits at lists.llvm.org
Thu Jan 27 15:44:18 PST 2022


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

  Changed paths:
    M clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
    M clang/test/OpenMP/target_globals_codegen.cpp

  Log Message:
  -----------
  [OpenMP] Only generate runtime flags with host input

This patch changes the code generation of runtime flags to only occur if
a host bitcode file was passed in. This is a cheap way to determine if
we are compiling the OpenMP device runtime itself or user code. This is
needed because the global flags we generate for the device runtime e.g.
__omp_rtl_debug_kind were being generated with default values when we
compiled the runtime library. This would then invalidate the ones we
want to be able to add in when the user defines it.

Reviewed By: jdoerfert

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


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

  Changed paths:
    M openmp/libomptarget/DeviceRTL/include/Debug.h
    M openmp/libomptarget/DeviceRTL/include/Synchronization.h
    M openmp/libomptarget/DeviceRTL/include/Utils.h
    M openmp/libomptarget/DeviceRTL/src/Synchronization.cpp

  Log Message:
  -----------
  [OpenMP] Ensure broken assumptions print once, not thousands of times.

If we have a broken assumption we want to print a message to the user.
If the assumption is broken by many threads in many teams this can
become a problem. To avoid it we use a hash that tracks if a broken
assumption has (likely) been printed and avoid printing it again. This
is not fool proof and has some caveats that might cause problems in
the future (see comment) but it should improve the situation
considerably for now.

Reviewed By: JonChesterfield

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


Compare: https://github.com/llvm/llvm-project/compare/1e3a02162db2...27c799ecc9e9


More information about the All-commits mailing list