-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[CMake] Preserve clang-prebolt #109351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CMake] Preserve clang-prebolt #109351
Conversation
Created using spr 1.3.4
Created using spr 1.3.4 [skip ci]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
PS. Let's drop ICF from the flags.
Created using spr 1.3.4
@llvm/pr-subscribers-clang Author: Amir Ayupov (aaupov) ChangesFull diff: https://github.com/llvm/llvm-project/pull/109351.diff 1 Files Affected:
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 46e1412c0727aa..07eeb8a451b58b 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -923,11 +923,14 @@ if (CLANG_BOLT AND NOT LLVM_BUILD_INSTRUMENTED)
)
add_custom_command(OUTPUT ${CLANG_OPTIMIZED}
DEPENDS clang-bolt-profile
+ COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:clang> ${CLANG_PATH}.prebolt
+ COMMAND ${CMAKE_COMMAND} -E create_symlink ${CLANG_PATH}.prebolt ${CLANG_PATH}++.prebolt
COMMAND llvm-bolt ${CLANG_PATH}
-o ${CLANG_OPTIMIZED}
-data ${BOLT_FDATA}
- -reorder-blocks=ext-tsp -reorder-functions=hfsort+ -split-functions
- -split-all-cold -split-eh -dyno-stats -icf=1 -use-gnu-stack
+ -reorder-blocks=ext-tsp -reorder-functions=cdsort -split-functions
+ -split-all-cold -split-eh -dyno-stats -use-gnu-stack
+ -split-strategy=cdsplit
${BOLT_NO_LBR}
COMMAND ${CMAKE_COMMAND} -E rename ${CLANG_OPTIMIZED} $<TARGET_FILE:clang>
COMMENT "Optimizing Clang with BOLT"
|
Created using spr 1.3.4
Created using spr 1.3.4 [skip ci]
This commit is breaking LTO-PGO-BOLT build while optimizing clang with BOLT.
More information on LTO-PGO-BOLT can be found on https://llvm.org/docs/AdvancedBuilds.html |
Here are CMAKE variables we use downstream.
|
This change was tested on a buildbot: https://lab.llvm.org/buildbot/#/builders/113/builds/2934 Can you please try cleaning the build directory? |
@aaupov this happens on AArch64 target, and only with -split-strategy=cdsplit enabled. Changing it to profile2, for example, fixes the issue |
Thanks for clarification. I'll drop cdsplit as we never tested it on AArch64. ARM clang-bolt buildbot hasn't picked this change up yet so I didn't get the signal. |
Breaks AArch64 Clang-BOLT builds: #109351 (comment)
llvm/llvm-project@76b2915 has dropped the use of clang++-bolt target. llvm/llvm-project#109351 has introduced the clang-prebolt binary that can be used as base version (since clang-bolt binary is no longer produced).
In Clang-BOLT step, preserve pre-BOLT Clang binary (as well as clang++
symlink).
Also modify the default set of BOLT flags: