[all-commits] [llvm/llvm-project] fa23a2: [libc] Fix linking of AMDGPU device runtime contro...
Joseph Huber via All-commits
all-commits at lists.llvm.org
Fri Oct 6 19:50:48 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: fa23a2396b6c8d64c3acc47223459ecb75938391
https://github.com/llvm/llvm-project/commit/fa23a2396b6c8d64c3acc47223459ecb75938391
Author: Joseph Huber <35342157+jhuber6 at users.noreply.github.com>
Date: 2023-10-06 (Fri, 06 Oct 2023)
Changed paths:
M libc/src/math/gpu/vendor/amdgpu/platform.h
Log Message:
-----------
[libc] Fix linking of AMDGPU device runtime control constants for math (#65676)
Summary:
Currently, `libc` temporarily provides math by linking against existing
vendor implementations. To use the AMDGPU DeviceRTL we need to define a
handful of control constants that alter behaviour for architecture
specific things. Previously these were marked `extern const` because
they must be present when we link-in the vendor bitcode library.
However, this causes linker errors if more than one math function was
used.
This patch fixes the issue by marking these functions as used and inline
on top of being external. This means that they are linkable, but it
gives us `linkonce_odr` semantics. The downside is that these globals
won't be optimized out, but it allows us to perform constant propagation
on them unlike using `weak`.
More information about the All-commits
mailing list