Skip to content
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

[lld][MachO] Add option to suppress mismatch profile errors #65551

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

ellishg
Copy link
Contributor

@ellishg ellishg commented Sep 7, 2023

Both ELF and COFF support --no-lto-pgo-warn-mismatch in https://reviews.llvm.org/D104431 to suppress warnings due to mismatching profile hashes. As profiles go stale, it becomes likely that some function's CFGs will change so that their profiles can no longer be used. This commit adds the linker option --no-pgo-warn-mismatch to suppress these warnings.

Note that we do have the LLVM backend flag no-pgo-warn-mismatch (

NoPGOWarnMismatch("no-pgo-warn-mismatch", cl::init(false), cl::Hidden,
) but that is set to true by default during LTO (
/// Turn on/off the warning about a hash mismatch in the PGO profile data.
bool PGOWarnMismatch = true;
).

lld/MachO/Options.td Outdated Show resolved Hide resolved
Both ELF and COFF support `--no-lto-pgo-warn-mismatch` in https://reviews.llvm.org/D104431 to suppress warnings due to mismatching profile hashes. As profiles go stale, it becomes likely that some function's CFGs will change so that their profiles can no longer be used. This commit adds the linker option `--no-pgo-warn-mismatch` to suppress these warnings.

Note that we do have the LLVM backend flag `no-pgo-warn-mismatch` (https://github.com/llvm/llvm-project/blob/3df1a64ebad8f31231ba05cf6ff43a985fea9235/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp#L210) but that is set to true by default during LTO (https://github.com/llvm/llvm-project/blob/3df1a64ebad8f31231ba05cf6ff43a985fea9235/llvm/include/llvm/LTO/Config.h#L76-L77).
@ellishg ellishg merged commit 30e688e into llvm:main Sep 11, 2023
2 of 3 checks passed
@ellishg ellishg deleted the lld-macho-pgo-warnings branch September 11, 2023 16:14
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this pull request Sep 19, 2023
Both ELF and COFF support `--no-lto-pgo-warn-mismatch` in
https://reviews.llvm.org/D104431 to suppress warnings due to mismatching
profile hashes. As profiles go stale, it becomes likely that some
function's CFGs will change so that their profiles can no longer be
used. This commit adds the linker option `--no-pgo-warn-mismatch` to
suppress these warnings.

Note that we do have the LLVM backend flag `no-pgo-warn-mismatch`
https://github.com/llvm/llvm-project/blob/3df1a64ebad8f31231ba05cf6ff43a985fea9235/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp#L210

but that is set to true by default during LTO
https://github.com/llvm/llvm-project/blob/3df1a64ebad8f31231ba05cf6ff43a985fea9235/llvm/include/llvm/LTO/Config.h#L76-L77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants