-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[llvm-profdata] Use semicolon as the delimiter for supplementary profiles. #75080
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
Merged
Conversation
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
…colon as delimiter for local-linkage varibles. Commit fe05193 (phab D156569), IRPGO names uses format '[<filepath>;]<linkage-name>' while prior format is [<filepath>:<linkage-name>'. The format change would break the use caes demonstrated in (updated) llvm/test/Transforms/PGOProfile/thinlto_indirect_call_promotion.ll This patch changes GlobalValues::getGlobalIdentifer to use the semicolon. To elaborate on the scenario how things break without this PR 1. IRPGO raw profiles stores (compressed) IRPGO names of functions in one section, and per-function profile data in another section. One field in per-function profile data is the MD5 hash of IRPGO names. 2. When raw profiles are converted to indexed format profiles, the profiled address is mapped to the MD5 hash of the callee. 3. In thin-lto prelink pipeline, MD5 hash of IRPGO names will be annotated as value profiles, and used to import indirect-call-prom candidates. If the annotated MD5 hash is computed from the new format while import uses the prior format, the callee cannot be imported. The updated test case Transforms/PGOProfile/thinlto_indirect_call_promotion.ll exercise the following path - Annotate raw profiles and generate import summaries. Using the imported summaries, it tests that functions are correctly imported and ICP transformations happened.
- Add thinlto indirect-call-promotion regression test as a compiler-rt test and remove the original IR test. - `clangxx_pgouse` is added in complier-rt lit config for test use. - In lib/IR/Globals.cpp, use '+=' operator for previous 'append' calls. - In llvm/ProfileData/InstrProf.h, update a few function comments. These comments used to refer to `getPGOFuncName` while the actual name could be returned by `getPGOFuncName` (clang instrumentation) or `getIRPGOFuncName` (ir instrumentation).
david-xl
approved these changes
Jan 2, 2024
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.
When merging instrFDO profiles with afdo profile as supplementary, instrFDO counters for static functions are stored with function's PGO name (with
filename.cpp;
prefix).