diff options
Diffstat (limited to 'bolt/lib/Profile/DataAggregator.cpp')
| -rw-r--r-- | bolt/lib/Profile/DataAggregator.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp index 0e6abdb2052a..4022212bcf1b 100644 --- a/bolt/lib/Profile/DataAggregator.cpp +++ b/bolt/lib/Profile/DataAggregator.cpp @@ -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); @@ -829,8 +831,13 @@ bool DataAggregator::doTrace(const LBREntry &First, const LBREntry &Second, << FromFunc->getPrintName() << ":" << Twine::utohexstr(First.To) << " to " << Twine::utohexstr(Second.From) << ".\n"); - for (auto [From, To] : *FTs) + for (auto [From, To] : *FTs) { + if (BAT) { + From = BAT->translate(FromFunc->getAddress(), From, /*IsBranchSrc=*/true); + To = BAT->translate(FromFunc->getAddress(), To, /*IsBranchSrc=*/false); + } doIntraBranch(*ParentFunc, From, To, Count, false); + } return true; } @@ -1217,7 +1224,7 @@ std::error_code DataAggregator::parseAggregatedLBREntry() { // Storage for parsed fields. StringRef EventName; std::optional<Location> Addr[3]; - int64_t Counters[2]; + int64_t Counters[2] = {0}; while (Type == INVALID || Type == EVENT_NAME) { while (checkAndConsumeFS()) { @@ -2248,7 +2255,6 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC, YamlBF.Id = BF->getFunctionNumber(); YamlBF.Hash = BAT->getBFHash(FuncAddress); YamlBF.ExecCount = BF->getKnownExecutionCount(); - YamlBF.ExternEntryCount = BF->getExternEntryCount(); YamlBF.NumBasicBlocks = BAT->getNumBasicBlocks(FuncAddress); const BoltAddressTranslation::BBHashMapTy &BlockMap = BAT->getBBHashMap(FuncAddress); |
