Skip to content

Commit

Permalink
[libc] Disable atomic optimizations for libc AMDGPU builds
Browse files Browse the repository at this point in the history
Recently the AMDGPU backend automatically enables a pass to optimize
atomics. This results in the LTO build taking about 10x longer in all
cases. For now we disable this by default as was the case before the
patch in D152649.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D153232
  • Loading branch information
jhuber6 committed Jun 19, 2023
1 parent 0eb0fec commit 5a8fc41
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc/startup/gpu/amdgpu/CMakeLists.txt
Expand Up @@ -26,4 +26,7 @@ target_link_libraries(
"--target=${LIBC_GPU_TARGET_TRIPLE}"
"-flto"
"-Wl,-mllvm,-amdgpu-lower-global-ctor-dtor=0"
# FIXME: This pass causes builds to take ~10x longer. Disable until the
# performance problems have been addressed.
"-Wl,-mllvm,-amdgpu-atomic-optimizations=0"
)

0 comments on commit 5a8fc41

Please sign in to comment.