diff options
author | Rafael Auler <rafaelauler@fb.com> | 2022-05-13 15:51:36 -0700 |
---|---|---|
committer | Rafael Auler <rafaelauler@fb.com> | 2022-05-13 19:41:55 -0700 |
commit | 2fdc5d336ed1fdcde4700a4c23777e0959d5c8d7 (patch) | |
tree | 35531c2b030999a9a45045e3017e39fb49a01d5d /bolt/tools | |
parent | 1f7f11b95104832a3ba046300c22e57051fa8d4e (diff) | |
download | llvm-2fdc5d336ed1fdcde4700a4c23777e0959d5c8d7.tar.gz |
[BOLT] Fix merge-fdata handling of BAT profiles
When a profile is collected in a BOLTed binary, the generated
profile is tagged with a header string "boltedcollection" in the first
line of the fdata file. Fix merge-fdata to recognize this header
string and preserve it into the output.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D125591
Diffstat (limited to 'bolt/tools')
-rw-r--r-- | bolt/tools/merge-fdata/merge-fdata.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bolt/tools/merge-fdata/merge-fdata.cpp b/bolt/tools/merge-fdata/merge-fdata.cpp index 5738219247ba..d0764646b0ae 100644 --- a/bolt/tools/merge-fdata/merge-fdata.cpp +++ b/bolt/tools/merge-fdata/merge-fdata.cpp @@ -257,8 +257,7 @@ void mergeLegacyProfiles(const cl::list<std::string> &Filenames) { Filename, "cannot mix profile collected in BOLT and non-BOLT deployments"); BoltedCollection = true; - if (!First) - Buf = Buf.drop_front(17); + Buf = Buf.drop_front(17); } else { if (BoltedCollection) report_error( @@ -282,6 +281,8 @@ void mergeLegacyProfiles(const cl::list<std::string> &Filenames) { First = false; } + if (BoltedCollection) + outs() << "boltedcollection\n"; for (const auto &Entry : Entries) outs() << Entry.getKey() << " " << Entry.getValue() << "\n"; |