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

Shilei Tian via All-commits all-commits at lists.llvm.org
Tue Dec 27 16:07:45 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 58906e4901ec5b7ed230d7fa96123654f6a974af
      https://github.com/llvm/llvm-project/commit/58906e4901ec5b7ed230d7fa96123654f6a974af
  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