[BOLT] Sort EntryData (#143308)

Aggregated branch data has two containers: `Data` for local branches,
and `EntryData` for external branches. Fix the omission and sort
`EntryData` to ensure stable output fdata profiles.

Test Plan: updated pre-aggregated-perf.test
This commit is contained in:
Amir Ayupov
2025-06-08 17:43:44 -07:00
committed by GitHub
parent c480dcddd9
commit dcd2ac7ef2
2 changed files with 20 additions and 17 deletions

View File

@@ -580,8 +580,10 @@ void DataAggregator::processProfile(BinaryContext &BC) {
}
}
for (auto &FuncBranches : NamesToBranches)
for (auto &FuncBranches : NamesToBranches) {
llvm::stable_sort(FuncBranches.second.Data);
llvm::stable_sort(FuncBranches.second.EntryData);
}
for (auto &MemEvents : NamesToMemEvents)
llvm::stable_sort(MemEvents.second.Data);