[all-commits] [llvm/llvm-project] 5a3a52: [OpenMP] Introduce basic JIT support to OpenMP tar...

Shilei Tian via All-commits all-commits at lists.llvm.org
Tue Dec 27 19:19:17 PST 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5a3a527f8ae220583981a122fda2a2c2eefa1a41
  Author: Shilei Tian <i at tianshilei.me>
  Date:   2022-12-27 (Tue, 27 Dec 2022)

  Changed paths:
    M openmp/libomptarget/CMakeLists.txt
    M openmp/libomptarget/plugins-nextgen/CMakeLists.txt
    M openmp/libomptarget/plugins-nextgen/common/PluginInterface/CMakeLists.txt
    A openmp/libomptarget/plugins-nextgen/common/PluginInterface/JIT.cpp
    A 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
    M openmp/libomptarget/test/lit.cfg

  Log Message:
  [OpenMP] Introduce basic JIT support to OpenMP target offloading

This patch adds the basic JIT support for OpenMP. Currently it only works on Nvidia GPUs.

The support for AMDGPU can be extended easily by just implementing three interface functions. However, the infrastructure requires a small extra extension (add a pre process hook) to support portability for AMDGPU because the AMDGPU backend reads target features of functions. https://github.com/shiltian/llvm-project/commit/02bc7effccc6ff2f5ab3fe5218336094c0485766#diff-321c2038035972ad4994ff9d85b29950ba72c08a79891db5048b8f5d46915314R432 shows how it roughly works.

As for the test, even though I added the corresponding code in CMake files, the test still cannot be triggered because some code is missing in the new plugin CMake file, which has nothing to do with this patch. It will be fixed later.

In order to enable JIT mode, when compiling, `-foffload-lto` is needed, and when linking, `-foffload-lto -Wl,--embed-bitcode` is needed. That implies that, LTO is required to enable JIT mode.

Reviewed By: jdoerfert

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

More information about the All-commits mailing list