From 5a8fc419379faa517e614c55b0b27de59572019d Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 19 Jun 2023 03:25:37 -0500 Subject: [PATCH] [libc] Disable atomic optimizations for `libc` AMDGPU builds 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 --- libc/startup/gpu/amdgpu/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libc/startup/gpu/amdgpu/CMakeLists.txt b/libc/startup/gpu/amdgpu/CMakeLists.txt index e7c0aeafafd9a..b54dc377a629b 100644 --- a/libc/startup/gpu/amdgpu/CMakeLists.txt +++ b/libc/startup/gpu/amdgpu/CMakeLists.txt @@ -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" )