-
Notifications
You must be signed in to change notification settings - Fork 12k
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
[BOLT] Fix boltedcollection and no_lbr order in fdata writer and parser #86501
base: main
Are you sure you want to change the base?
Conversation
…are set at the same time
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
Thank you for spotting an issue. Can you please add a trivial test case? Profile containing both lines in the wrong order. |
✅ With the latest revision this PR passed the C/C++ code formatter. |
✅ With the latest revision this PR passed the Python code formatter. |
@aaupov Here are the test cases First we get a BOLT optimized binary(bolt_1), profile use no_lbr and enable BAT model
Then we use the profile collected from the bolt_1 and perform the second optimization, the error has occurred
The contents of file perf.fdata_2
llvm-bolt errors
The reason is what I said at the beginning about the order problem |
@aaupov ping |
Sorry, I meant a simple test with fdata profile containing the lines in the right order, and that BOLT succeeds reading it. Please check similar tests under bolt/test. |
when BAT and no_lbr are set at the same time, the perf2bolt writes boltedcollection first and then no_lbr
llvm-project/bolt/lib/Profile/DataAggregator.cpp
Lines 2219 to 2225 in e6f63a9
However, when used, llvm-bolt reads the no_lbr first, and then the boltedcollection
llvm-project/bolt/lib/Profile/DataReader.cpp
Lines 1175 to 1183 in e6f63a9
This causes an error when reading profile data,because the profile first line is boltedcollection,the maybeParseNoLBRFlag return false despite no_lbr was use
BOLT-INFO: pre-processing profile using branch profile reader ERROR: no valid profile data found BOLT-ERROR: 'cannot pre-process profile': Input/output error.
So we adjusted the order of the reads