[all-commits] [llvm/llvm-project] 772173: [Clang][AMDGPU] Remove special handling for COV4 l...

Joseph Huber via All-commits all-commits at lists.llvm.org
Fri Mar 28 05:35:39 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 772173f54868eef6e1a4d40ab93b0ee6c04b1aca
      https://github.com/llvm/llvm-project/commit/772173f54868eef6e1a4d40ab93b0ee6c04b1aca
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2025-03-28 (Fri, 28 Mar 2025)

  Changed paths:
    M clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
    M clang/lib/CodeGen/Targets/AMDGPU.cpp
    M clang/test/CodeGen/amdgpu-abi-version.c
    M clang/test/CodeGen/amdgpu-address-spaces.cpp
    R clang/test/CodeGenCUDA/amdgpu-code-object-version-linking.cu
    M clang/test/CodeGenCUDA/amdgpu-workgroup-size.cu
    M clang/test/CodeGenCXX/dynamic-cast-address-space.cpp
    M clang/test/CodeGenHIP/default-attributes.hip
    M clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
    M clang/test/OpenMP/amdgcn_target_global_constructor.cpp
    M compiler-rt/cmake/builtin-config-ix.cmake
    M compiler-rt/lib/builtins/CMakeLists.txt
    M flang/lib/Frontend/FrontendActions.cpp
    R flang/test/Lower/AMD/code-object-version.f90
    M libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
    M libcxx/cmake/caches/AMDGPU.cmake
    M offload/DeviceRTL/CMakeLists.txt

  Log Message:
  -----------
  [Clang][AMDGPU] Remove special handling for COV4 libraries (#132870)

Summary:
When we were first porting to COV5, this lead to some ABI issues due to
a change in how we looked up the work group size. Bitcode libraries
relied on the builtins to emit code, but this was changed between
versions. This prevented the bitcode libraries, like OpenMP or libc,
from being used for both COV4 and COV5. The solution was to have this
'none' functionality which effectively emitted code that branched off of
a global to resolve to either version.

This isn't a great solution because it forced every TU to have this
variable in it. The patch in
https://github.com/llvm/llvm-project/pull/131033 removed support for
COV4 from OpenMP, which was the only consumer of this functionality.
Other users like HIP and OpenCL did not use this because they linked the
ROCm Device Library directly which has its own handling (The name was
borrowed from it after all).

So, now that we don't need to worry about backward compatibility with
COV4, we can remove this special handling. Users can still emit COV4
code, this simply removes the special handling used to make the OpenMP
device runtime bitcode version agnostic.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list