Repository navigation
Conversation
Add CMake options for 2-phase IR Profile-Guided Optimization (PGO) builds with Clang: - `BYN_PGO_GENERATE`: Adds `-fprofile-generate` to compile flags. On Windows with `clang-cl` (`MSVC`), CMake invokes `lld-link` directly rather than linking through the compiler driver, so query `clang-cl` for its compiler-rt directory and pass `/libpath:"<dir>"` so `lld-link` resolves the embedded `clang_rt.profile-*.lib` directive; on other platforms, pass `-fprofile-generate` to the linker driver. - `BYN_PGO_PROFILE_FILE`: Adds `-fprofile-instr-use="<path>"` and `-Wno-backend-plugin` (to avoid harmless `main()` CFG hash-mismatch warnings across tools other than `wasm-opt` when `-Werror` is enabled) to compile flags, and passes `-fprofile-instr-use="<path>"` to link flags on non-MSVC platforms.
Member
Author
|
We'll use this for the emscripten-releases release-optimized builds. So... maybe we can get away without CI coverage for this on the Binaryen side? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add CMake options for 2-phase IR Profile-Guided Optimization (PGO)
builds with Clang:
BYN_PGO_GENERATE: Adds-fprofile-generateto compile flags. OnWindows with
clang-cl(MSVC), CMake invokeslld-linkdirectlyrather than linking through the compiler driver, so query
clang-clfor its compiler-rt directory and pass
/libpath:"<dir>"solld-linkresolves the embeddedclang_rt.profile-*.libdirective;on other platforms, pass
-fprofile-generateto the linker driver.BYN_PGO_PROFILE_FILE: Adds-fprofile-instr-use="<path>"and-Wno-backend-plugin(to avoid harmlessmain()CFG hash-mismatchwarnings across tools other than
wasm-optwhen-Werroris enabled)to compile flags, and passes
-fprofile-instr-use="<path>"to linkflags on non-MSVC platforms.