[llvm-branch-commits] [llvm] [BOLT][NFC] Rename DataAggregator::BranchInfo to TakenInfo (PR #92017)
Amir Ayupov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu May 16 20:01:11 PDT 2024
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/92017
>From 096f5cc4cae69a428629a8c05f5e4ce373ca7d60 Mon Sep 17 00:00:00 2001
From: Amir Ayupov <aaupov at fb.com>
Date: Thu, 16 May 2024 23:00:50 -0400
Subject: [PATCH] TakenBranchInfo
Created using spr 1.3.5
---
bolt/include/bolt/Profile/DataAggregator.h | 4 ++--
bolt/lib/Profile/DataAggregator.cpp | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/bolt/include/bolt/Profile/DataAggregator.h b/bolt/include/bolt/Profile/DataAggregator.h
index 48f01511f4827..c158a9bb3e3f2 100644
--- a/bolt/include/bolt/Profile/DataAggregator.h
+++ b/bolt/include/bolt/Profile/DataAggregator.h
@@ -122,14 +122,14 @@ class DataAggregator : public DataReader {
uint64_t ExternCount{0};
};
- struct TakenInfo {
+ struct TakenBranchInfo {
uint64_t TakenCount{0};
uint64_t MispredCount{0};
};
/// Intermediate storage for profile data. We save the results of parsing
/// and use them later for processing and assigning profile.
- std::unordered_map<Trace, TakenInfo, TraceHash> BranchLBRs;
+ std::unordered_map<Trace, TakenBranchInfo, TraceHash> BranchLBRs;
std::unordered_map<Trace, FTInfo, TraceHash> FallthroughLBRs;
std::vector<AggregatedLBREntry> AggregatedLBRs;
std::unordered_map<uint64_t, uint64_t> BasicSamples;
diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp
index 0e11963c676f0..e06debcee741e 100644
--- a/bolt/lib/Profile/DataAggregator.cpp
+++ b/bolt/lib/Profile/DataAggregator.cpp
@@ -1464,7 +1464,7 @@ uint64_t DataAggregator::parseLBRSample(const PerfBranchSample &Sample,
uint64_t To = getBinaryFunctionContainingAddress(LBR.To) ? LBR.To : 0;
if (!From && !To)
continue;
- TakenInfo &Info = BranchLBRs[Trace(From, To)];
+ TakenBranchInfo &Info = BranchLBRs[Trace(From, To)];
++Info.TakenCount;
Info.MispredCount += LBR.Mispred;
}
@@ -1609,7 +1609,7 @@ void DataAggregator::processBranchEvents() {
for (const auto &AggrLBR : BranchLBRs) {
const Trace &Loc = AggrLBR.first;
- const TakenInfo &Info = AggrLBR.second;
+ const TakenBranchInfo &Info = AggrLBR.second;
doBranch(Loc.From, Loc.To, Info.TakenCount, Info.MispredCount);
}
}
More information about the llvm-branch-commits
mailing list