[all-commits] [llvm/llvm-project] 158aa9: [OpenMP][NFC] Introduce helper functions to hide c...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Sun Jan 15 11:44:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 158aa99d39a27e5008293ab7148ec6c403f7fc8f
      https://github.com/llvm/llvm-project/commit/158aa99d39a27e5008293ab7148ec6c403f7fc8f
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2023-01-15 (Sun, 15 Jan 2023)

  Changed paths:
    M openmp/libomptarget/include/Utilities.h
    M openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
    M openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp
    M openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
    M openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h

  Log Message:
  -----------
  [OpenMP][NFC] Introduce helper functions to hide casts and such

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


  Commit: f8e094be8166443383f84831a406960a49281f04
      https://github.com/llvm/llvm-project/commit/f8e094be8166443383f84831a406960a49281f04
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2023-01-15 (Sun, 15 Jan 2023)

  Changed paths:
    M openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
    M openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
    M openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.h
    M openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
    M openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h
    M openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
    M openmp/libomptarget/plugins-nextgen/generic-elf-64bit/src/rtl.cpp

  Log Message:
  -----------
  [OpenMP][JIT] Cleanup JIT interface, caching, and races

The JIT interface was somewhat irregular as it used multiple global
functions. It also did not cache the results of the JIT, hence multiple
GPU systems would perform the work multiple times. Finally, there might
have been races on the state if we have multi-threaded initialization of
different embedded images, or one image initialized on multiple devices.

This patch tries to rectify all of the above. The JITEngine is now a
part of the GenericPluginTy and tied to one target triple. To support
multiple "ComputeUnitKind"s (previously confusingly called Arch or
[M]CPU) and to avoid re-jitting for the same ComputeUnitKind, we keep a
map of JIT results per ComputeUnitKind. All interaction with the JIT
happens through the JITEngine directly, two functions are exposed. Both
use (shared) locks to avoid races and cache the result. All JIT-related
environment variables are now defined together.

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


  Commit: d9415cd0241ebd7d426d0827ee0c65649018f90b
      https://github.com/llvm/llvm-project/commit/d9415cd0241ebd7d426d0827ee0c65649018f90b
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2023-01-15 (Sun, 15 Jan 2023)

  Changed paths:
    M openmp/docs/design/Runtimes.rst
    M openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
    M openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.h

  Log Message:
  -----------
  [OpenMP][JIT] Introduce more debugging configuration options

The JIT is a great debugging tool since we can modify the IR manually
before launching it in an existing test case. The new flasks allow to
skip optimizations, to use the exact given IR, as well as to provide a
finished object file. The latter is useful to try out different backend
options and to have complete freedom with pass pipelines.

Documentation is included. Minimal refactoring was performed to make the
second object fit in nicely.


Compare: https://github.com/llvm/llvm-project/compare/93ccccb00d97...d9415cd0241e


More information about the All-commits mailing list