[all-commits] [llvm/llvm-project] 9fa9d9: [llvm][frontend][offloading] Move clang-linker-wra...

Fabian Mora via All-commits all-commits at lists.llvm.org
Mon Jan 15 13:30:19 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9fa9d9a7e1cd0a7fd8c35bdfc642793447bf70aa
      https://github.com/llvm/llvm-project/commit/9fa9d9a7e1cd0a7fd8c35bdfc642793447bf70aa
  Author: Fabian Mora <fmora.dev at gmail.com>
  Date:   2024-01-15 (Mon, 15 Jan 2024)

  Changed paths:
    M clang/test/Driver/linker-wrapper-image.c
    M clang/tools/clang-linker-wrapper/CMakeLists.txt
    M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
    R clang/tools/clang-linker-wrapper/OffloadWrapper.cpp
    R clang/tools/clang-linker-wrapper/OffloadWrapper.h
    A llvm/include/llvm/Frontend/Offloading/OffloadWrapper.h
    M llvm/include/llvm/Frontend/Offloading/Utility.h
    M llvm/lib/Frontend/Offloading/CMakeLists.txt
    A llvm/lib/Frontend/Offloading/OffloadWrapper.cpp
    M llvm/lib/Frontend/Offloading/Utility.cpp

  Log Message:
  -----------
  [llvm][frontend][offloading] Move clang-linker-wrapper/OffloadWrapper.* to llvm/Frontend/Offloading (#78057)

This patch moves `clang/tools/clang-linker-wrapper/OffloadWrapper.*` to
`llvm/Frontend/Offloading` allowing them to be re-utilized by other
projects.

Additionally, it makes minor modifications to the API to make it more
flexible.
Concretely:
 - The `wrap*` methods now have additional arguments `EntryArray`, 
`Suffix` and `EmitSurfacesAndTextures` to specify some additional options.
- The `EntryArray` is now constructed by the caller. This change is needed to
enable JIT compilation, as ORC doesn't fully support `__start_` and `__stop_` 
symbols. Thus, to JIT the code, the `EntryArray` has to be constructed explicitly in the IR.
- The `Suffix` field is used when emitting the descriptor, registration
methods, etc, to make them more readable. It is empty by default.
- The `EmitSurfacesAndTextures` field controls whether to emit surface
and texture registration code, as those functions were removed from `CUDART`
in CUDA 12. It is true by default.
- The function `getOffloadingEntryInitializer` was added to help create
the `EntryArray`, as it returns the constant initializer and not a global
variable.




More information about the All-commits mailing list