[BOLT] Sort BranchData in DataAggregator
authorAmir Ayupov <aaupov@fb.com>
Thu, 15 Jun 2023 19:08:07 +0000 (12:08 -0700)
committerAmir Ayupov <aaupov@fb.com>
Thu, 15 Jun 2023 19:08:57 +0000 (12:08 -0700)
commit224e4cc516c747b4096fdbe4f2c8d46005eaaa65
treec9564e997f4caff864dd16e94ab541a34e14d564
parenteea865bd4a5348da374586d156aa1cc92eaeb562
[BOLT] Sort BranchData in DataAggregator

Align perf reader to fdata behavior by sorting BranchData after reading samples,
in the same way as DataReader:
https://github.com/llvm/llvm-project/blob/20c66a0c66340f44f04b6526e45bcc5d872d480a/bolt/lib/Profile/DataReader.cpp#L1239

Namely, that order affects CallSiteInfo annotations which determine the
construction order of CallGraph, which in turn affects function reordering.

Reviewed By: #bolt, rafauler

Differential Revision: https://reviews.llvm.org/D152731
bolt/lib/Profile/DataAggregator.cpp
bolt/test/runtime/X86/fdata-escape-chars.ll