From ef3a6bd37c1508e52e9f63d726b9d8fd2b5896f9 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Fri, 29 Aug 2025 10:06:26 -0700 Subject: [PATCH] [Clang][CMake] Use IRPGO instead of FE PGO for Cmake Caches (#155957) Currently the clang CMake caches use FE PGO for instrumentation (LLVM_BUILD_INSTRUMENTED=ON). However, IRPGO is generally regarded as better for performance. I am measuring about a 1.5% performance gain when building libLLVMSupport.a using this configuration versus what existed before this commit. I would suspect the gains are larger on other platforms like Windows where we cannot subsume any gains using PLO. (cherry picked from commit 7fca1f841b4c226d50ab7bad64de5db225d4193b) --- clang/cmake/caches/PGO.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/cmake/caches/PGO.cmake b/clang/cmake/caches/PGO.cmake index 15bc755d110d1..d6471160037c1 100644 --- a/clang/cmake/caches/PGO.cmake +++ b/clang/cmake/caches/PGO.cmake @@ -5,7 +5,7 @@ set(LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "") set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "") set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "") -set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "") +set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED IR CACHE BOOL "") set(CLANG_BOOTSTRAP_TARGETS generate-profdata stage2