-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[BOLT][NFC] Disambiguate sample as basic sample #139350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BOLT][NFC] Disambiguate sample as basic sample #139350
Conversation
Created using spr 1.3.4
Created using spr 1.3.4 [skip ci]
@llvm/pr-subscribers-bolt Author: Amir Ayupov (aaupov) ChangesSample is a general term covering both basic (IP) and branch (LBR) Follow-up to #137644. Test Plan: NFC Patch is 21.42 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/139350.diff 14 Files Affected:
diff --git a/bolt/include/bolt/Core/BinaryFunction.h b/bolt/include/bolt/Core/BinaryFunction.h
index a52998564ee1b..0fd199acec1e9 100644
--- a/bolt/include/bolt/Core/BinaryFunction.h
+++ b/bolt/include/bolt/Core/BinaryFunction.h
@@ -143,7 +143,7 @@ class BinaryFunction {
enum {
PF_NONE = 0, /// No profile.
PF_LBR = 1, /// Profile is based on last branch records.
- PF_SAMPLE = 2, /// Non-LBR sample-based profile.
+ PF_IP = 2, /// Non-LBR sample-based profile.
PF_MEMEVENT = 4, /// Profile has mem events.
};
@@ -387,7 +387,7 @@ class BinaryFunction {
float ProfileMatchRatio{0.0f};
/// Raw branch count for this function in the profile.
- uint64_t RawBranchCount{0};
+ uint64_t RawSampleCount{0};
/// Dynamically executed function bytes, used for density computation.
uint64_t SampleCountInBytes{0};
@@ -1882,11 +1882,11 @@ class BinaryFunction {
/// Return the raw profile information about the number of branch
/// executions corresponding to this function.
- uint64_t getRawBranchCount() const { return RawBranchCount; }
+ uint64_t getRawSampleCount() const { return RawSampleCount; }
/// Set the profile data about the number of branch executions corresponding
/// to this function.
- void setRawBranchCount(uint64_t Count) { RawBranchCount = Count; }
+ void setRawSampleCount(uint64_t Count) { RawSampleCount = Count; }
/// Return the number of dynamically executed bytes, from raw perf data.
uint64_t getSampleCountInBytes() const { return SampleCountInBytes; }
diff --git a/bolt/include/bolt/Profile/DataAggregator.h b/bolt/include/bolt/Profile/DataAggregator.h
index c4ee75e7a6da6..5eddd85ab7a4c 100644
--- a/bolt/include/bolt/Profile/DataAggregator.h
+++ b/bolt/include/bolt/Profile/DataAggregator.h
@@ -257,7 +257,8 @@ class DataAggregator : public DataReader {
/// Semantic actions - parser hooks to interpret parsed perf samples
/// Register a sample (non-LBR mode), i.e. a new hit at \p Address
- bool doSample(BinaryFunction &Func, const uint64_t Address, uint64_t Count);
+ bool doBasicSample(BinaryFunction &Func, const uint64_t Address,
+ uint64_t Count);
/// Register an intraprocedural branch \p Branch.
bool doIntraBranch(BinaryFunction &Func, uint64_t From, uint64_t To,
diff --git a/bolt/include/bolt/Profile/DataReader.h b/bolt/include/bolt/Profile/DataReader.h
index a7a0933bd4f03..b91efca085c8c 100644
--- a/bolt/include/bolt/Profile/DataReader.h
+++ b/bolt/include/bolt/Profile/DataReader.h
@@ -218,15 +218,16 @@ struct FuncMemData {
/// Similar to BranchInfo, but instead of recording from-to address (an edge),
/// it records the address of a perf event and the number of times samples hit
/// this address.
-struct SampleInfo {
+struct BasicSampleInfo {
Location Loc;
int64_t Hits;
- SampleInfo(Location Loc, int64_t Hits) : Loc(std::move(Loc)), Hits(Hits) {}
+ BasicSampleInfo(Location Loc, int64_t Hits)
+ : Loc(std::move(Loc)), Hits(Hits) {}
- bool operator==(const SampleInfo &RHS) const { return Loc == RHS.Loc; }
+ bool operator==(const BasicSampleInfo &RHS) const { return Loc == RHS.Loc; }
- bool operator<(const SampleInfo &RHS) const {
+ bool operator<(const BasicSampleInfo &RHS) const {
if (Loc < RHS.Loc)
return true;
@@ -235,18 +236,18 @@ struct SampleInfo {
void print(raw_ostream &OS) const;
- void mergeWith(const SampleInfo &SI);
+ void mergeWith(const BasicSampleInfo &SI);
};
/// Helper class to store samples recorded in the address space of a given
/// function, analogous to FuncBranchData but for samples instead of branches.
-struct FuncSampleData {
- typedef std::vector<SampleInfo> ContainerTy;
+struct FuncBasicSampleData {
+ typedef std::vector<BasicSampleInfo> ContainerTy;
StringRef Name;
ContainerTy Data;
- FuncSampleData(StringRef Name, ContainerTy Data)
+ FuncBasicSampleData(StringRef Name, ContainerTy Data)
: Name(Name), Data(std::move(Data)) {}
/// Get the number of samples recorded in [Start, End)
@@ -314,7 +315,7 @@ class DataReader : public ProfileReaderBase {
/// The last step is to infer edge counts based on BB execution count. Note
/// this is the opposite of the LBR way, where we infer BB execution count
/// based on edge counts.
- void readSampleData(BinaryFunction &BF);
+ void readBasicSampleData(BinaryFunction &BF);
/// Convert function-level branch data into instruction annotations.
void convertBranchData(BinaryFunction &BF) const;
@@ -388,7 +389,8 @@ class DataReader : public ProfileReaderBase {
/// Return mem data matching one of the names in \p FuncNames.
FuncMemData *getMemDataForNames(const std::vector<StringRef> &FuncNames);
- FuncSampleData *getFuncSampleData(const std::vector<StringRef> &FuncNames);
+ FuncBasicSampleData *
+ getFuncSampleData(const std::vector<StringRef> &FuncNames);
/// Return a vector of all FuncBranchData matching the list of names.
/// Internally use fuzzy matching to match special names like LTO-generated
@@ -431,7 +433,7 @@ class DataReader : public ProfileReaderBase {
}
using NamesToBranchesMapTy = std::map<StringRef, FuncBranchData>;
- using NamesToSamplesMapTy = std::map<StringRef, FuncSampleData>;
+ using NamesToSamplesMapTy = std::map<StringRef, FuncBasicSampleData>;
using NamesToMemEventsMapTy = std::map<StringRef, FuncMemData>;
using FuncsToBranchesMapTy =
std::unordered_map<const BinaryFunction *, FuncBranchData *>;
@@ -480,7 +482,7 @@ class DataReader : public ProfileReaderBase {
return parseLocation(EndChar, EndNl, true);
}
ErrorOr<BranchInfo> parseBranchInfo();
- ErrorOr<SampleInfo> parseSampleInfo();
+ ErrorOr<BasicSampleInfo> parseSampleInfo();
ErrorOr<MemInfo> parseMemInfo();
ErrorOr<bool> maybeParseNoLBRFlag();
ErrorOr<bool> maybeParseBATFlag();
diff --git a/bolt/include/bolt/Profile/ProfileYAMLMapping.h b/bolt/include/bolt/Profile/ProfileYAMLMapping.h
index a8c9f7a10bbb9..f45d411ee65ee 100644
--- a/bolt/include/bolt/Profile/ProfileYAMLMapping.h
+++ b/bolt/include/bolt/Profile/ProfileYAMLMapping.h
@@ -231,7 +231,7 @@ LLVM_YAML_STRONG_TYPEDEF(uint16_t, PROFILE_PF)
template <> struct ScalarBitSetTraits<PROFILE_PF> {
static void bitset(IO &io, PROFILE_PF &value) {
io.bitSetCase(value, "lbr", BinaryFunction::PF_LBR);
- io.bitSetCase(value, "sample", BinaryFunction::PF_SAMPLE);
+ io.bitSetCase(value, "sample", BinaryFunction::PF_IP);
io.bitSetCase(value, "memevent", BinaryFunction::PF_MEMEVENT);
}
};
diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp
index 9773e21aa7522..c110632f4bb1b 100644
--- a/bolt/lib/Core/BinaryFunction.cpp
+++ b/bolt/lib/Core/BinaryFunction.cpp
@@ -473,7 +473,7 @@ void BinaryFunction::print(raw_ostream &OS, std::string Annotation) {
OS << "\n Image : 0x" << Twine::utohexstr(getImageAddress());
if (ExecutionCount != COUNT_NO_PROFILE) {
OS << "\n Exec Count : " << ExecutionCount;
- OS << "\n Branch Count: " << RawBranchCount;
+ OS << "\n Sample Count: " << RawSampleCount;
OS << "\n Profile Acc : " << format("%.1f%%", ProfileMatchRatio * 100.0f);
}
diff --git a/bolt/lib/Passes/BinaryPasses.cpp b/bolt/lib/Passes/BinaryPasses.cpp
index d8628c62d8654..420ffc8e01c5c 100644
--- a/bolt/lib/Passes/BinaryPasses.cpp
+++ b/bolt/lib/Passes/BinaryPasses.cpp
@@ -1445,7 +1445,7 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {
if (!Function.hasProfile())
continue;
- uint64_t SampleCount = Function.getRawBranchCount();
+ uint64_t SampleCount = Function.getRawSampleCount();
TotalSampleCount += SampleCount;
if (Function.hasValidProfile()) {
diff --git a/bolt/lib/Passes/MCF.cpp b/bolt/lib/Passes/MCF.cpp
index 77dea7369140e..cd254a41ffd89 100644
--- a/bolt/lib/Passes/MCF.cpp
+++ b/bolt/lib/Passes/MCF.cpp
@@ -458,7 +458,7 @@ void EstimateEdgeCounts::runOnFunction(BinaryFunction &BF) {
Error EstimateEdgeCounts::runOnFunctions(BinaryContext &BC) {
if (llvm::none_of(llvm::make_second_range(BC.getBinaryFunctions()),
[](const BinaryFunction &BF) {
- return BF.getProfileFlags() == BinaryFunction::PF_SAMPLE;
+ return BF.getProfileFlags() == BinaryFunction::PF_IP;
}))
return Error::success();
@@ -466,7 +466,7 @@ Error EstimateEdgeCounts::runOnFunctions(BinaryContext &BC) {
runOnFunction(BF);
};
ParallelUtilities::PredicateTy SkipFunc = [&](const BinaryFunction &BF) {
- return BF.getProfileFlags() != BinaryFunction::PF_SAMPLE;
+ return BF.getProfileFlags() != BinaryFunction::PF_IP;
};
ParallelUtilities::runOnEachFunction(
diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp
index dda737341a9c6..7a85297fe5f0e 100644
--- a/bolt/lib/Profile/DataAggregator.cpp
+++ b/bolt/lib/Profile/DataAggregator.cpp
@@ -571,10 +571,10 @@ void DataAggregator::processProfile(BinaryContext &BC) {
BinaryFunction &BF = BFI.second;
if (FuncBranchData *FBD = getBranchData(BF)) {
BF.markProfiled(BinaryFunction::PF_LBR);
- BF.RawBranchCount = FBD->getNumExecutedBranches();
- } else if (FuncSampleData *FSD = getFuncSampleData(BF.getNames())) {
- BF.markProfiled(BinaryFunction::PF_SAMPLE);
- BF.RawBranchCount = FSD->getSamples();
+ BF.RawSampleCount = FBD->getNumExecutedBranches();
+ } else if (FuncBasicSampleData *FSD = getFuncSampleData(BF.getNames())) {
+ BF.markProfiled(BinaryFunction::PF_IP);
+ BF.RawSampleCount = FSD->getSamples();
}
}
@@ -629,8 +629,8 @@ StringRef DataAggregator::getLocationName(const BinaryFunction &Func,
return OrigFunc->getOneName();
}
-bool DataAggregator::doSample(BinaryFunction &OrigFunc, uint64_t Address,
- uint64_t Count) {
+bool DataAggregator::doBasicSample(BinaryFunction &OrigFunc, uint64_t Address,
+ uint64_t Count) {
// To record executed bytes, use basic block size as is regardless of BAT.
uint64_t BlockSize = 0;
if (BinaryBasicBlock *BB = OrigFunc.getBasicBlockContainingOffset(
@@ -648,9 +648,9 @@ bool DataAggregator::doSample(BinaryFunction &OrigFunc, uint64_t Address,
if (I == NamesToSamples.end()) {
bool Success;
StringRef LocName = getLocationName(Func, BAT);
- std::tie(I, Success) = NamesToSamples.insert(
- std::make_pair(Func.getOneName(),
- FuncSampleData(LocName, FuncSampleData::ContainerTy())));
+ std::tie(I, Success) = NamesToSamples.insert(std::make_pair(
+ Func.getOneName(),
+ FuncBasicSampleData(LocName, FuncBasicSampleData::ContainerTy())));
}
Address -= Func.getAddress();
@@ -1663,7 +1663,7 @@ void DataAggregator::processBasicEvents() {
continue;
}
- doSample(*Func, PC, HitCount);
+ doBasicSample(*Func, PC, HitCount);
}
outs() << "PERF2BOLT: read " << NumTotalSamples << " samples\n";
@@ -2195,8 +2195,8 @@ DataAggregator::writeAggregatedFile(StringRef OutputFilename) const {
OutFile << "\n";
for (const auto &KV : NamesToSamples) {
- const FuncSampleData &FSD = KV.second;
- for (const SampleInfo &SI : FSD.Data) {
+ const FuncBasicSampleData &FSD = KV.second;
+ for (const BasicSampleInfo &SI : FSD.Data) {
writeLocation(SI.Loc);
OutFile << SI.Hits << "\n";
++BranchValues;
@@ -2269,8 +2269,8 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
for (const StringMapEntry<std::nullopt_t> &EventEntry : EventNames)
EventNamesOS << LS << EventEntry.first().str();
- BP.Header.Flags = opts::BasicAggregation ? BinaryFunction::PF_SAMPLE
- : BinaryFunction::PF_LBR;
+ BP.Header.Flags =
+ opts::BasicAggregation ? BinaryFunction::PF_IP : BinaryFunction::PF_LBR;
// Add probe inline tree nodes.
YAMLProfileWriter::InlineTreeDesc InlineTree;
diff --git a/bolt/lib/Profile/DataReader.cpp b/bolt/lib/Profile/DataReader.cpp
index 42b1557db3f02..fda62e8c073ea 100644
--- a/bolt/lib/Profile/DataReader.cpp
+++ b/bolt/lib/Profile/DataReader.cpp
@@ -103,20 +103,20 @@ uint64_t FuncBranchData::getNumExecutedBranches() const {
return ExecutedBranches;
}
-void SampleInfo::mergeWith(const SampleInfo &SI) { Hits += SI.Hits; }
+void BasicSampleInfo::mergeWith(const BasicSampleInfo &SI) { Hits += SI.Hits; }
-void SampleInfo::print(raw_ostream &OS) const {
+void BasicSampleInfo::print(raw_ostream &OS) const {
OS << Loc.IsSymbol << " " << Loc.Name << " " << Twine::utohexstr(Loc.Offset)
<< " " << Hits << "\n";
}
-uint64_t FuncSampleData::getSamples(uint64_t Start, uint64_t End) const {
+uint64_t FuncBasicSampleData::getSamples(uint64_t Start, uint64_t End) const {
assert(llvm::is_sorted(Data));
struct Compare {
- bool operator()(const SampleInfo &SI, const uint64_t Val) const {
+ bool operator()(const BasicSampleInfo &SI, const uint64_t Val) const {
return SI.Loc.Offset < Val;
}
- bool operator()(const uint64_t Val, const SampleInfo &SI) const {
+ bool operator()(const uint64_t Val, const BasicSampleInfo &SI) const {
return Val < SI.Loc.Offset;
}
};
@@ -128,21 +128,21 @@ uint64_t FuncSampleData::getSamples(uint64_t Start, uint64_t End) const {
return Result;
}
-uint64_t FuncSampleData::getSamples() const {
+uint64_t FuncBasicSampleData::getSamples() const {
uint64_t Result = 0;
- for (const SampleInfo &I : Data)
+ for (const BasicSampleInfo &I : Data)
Result += I.Hits;
return Result;
}
-void FuncSampleData::bumpCount(uint64_t Offset, uint64_t Count) {
+void FuncBasicSampleData::bumpCount(uint64_t Offset, uint64_t Count) {
auto Iter = Index.find(Offset);
if (Iter == Index.end()) {
Data.emplace_back(Location(true, Name, Offset), Count);
Index[Offset] = Data.size() - 1;
return;
}
- SampleInfo &SI = Data[Iter->second];
+ BasicSampleInfo &SI = Data[Iter->second];
SI.Hits += Count;
}
@@ -358,8 +358,8 @@ void DataReader::readProfile(BinaryFunction &BF) {
return;
if (!hasLBR()) {
- BF.ProfileFlags = BinaryFunction::PF_SAMPLE;
- readSampleData(BF);
+ BF.ProfileFlags = BinaryFunction::PF_IP;
+ readBasicSampleData(BF);
return;
}
@@ -414,12 +414,12 @@ void DataReader::matchProfileData(BinaryFunction &BF) {
FuncBranchData *FBD = getBranchData(BF);
if (FBD) {
BF.ProfileMatchRatio = evaluateProfileData(BF, *FBD);
- BF.RawBranchCount = FBD->getNumExecutedBranches();
+ BF.RawSampleCount = FBD->getNumExecutedBranches();
if (BF.ProfileMatchRatio == 1.0f) {
if (fetchProfileForOtherEntryPoints(BF)) {
BF.ProfileMatchRatio = evaluateProfileData(BF, *FBD);
BF.ExecutionCount = FBD->ExecutionCount;
- BF.RawBranchCount = FBD->getNumExecutedBranches();
+ BF.RawSampleCount = FBD->getNumExecutedBranches();
}
return;
}
@@ -561,8 +561,8 @@ float DataReader::evaluateProfileData(BinaryFunction &BF,
return MatchRatio;
}
-void DataReader::readSampleData(BinaryFunction &BF) {
- FuncSampleData *SampleDataOrErr = getFuncSampleData(BF.getNames());
+void DataReader::readBasicSampleData(BinaryFunction &BF) {
+ FuncBasicSampleData *SampleDataOrErr = getFuncSampleData(BF.getNames());
if (!SampleDataOrErr)
return;
@@ -1013,7 +1013,7 @@ ErrorOr<MemInfo> DataReader::parseMemInfo() {
return MemInfo(Offset, Addr, CountRes.get());
}
-ErrorOr<SampleInfo> DataReader::parseSampleInfo() {
+ErrorOr<BasicSampleInfo> DataReader::parseSampleInfo() {
ErrorOr<Location> Res = parseLocation(FieldSeparator);
if (std::error_code EC = Res.getError())
return EC;
@@ -1031,7 +1031,7 @@ ErrorOr<SampleInfo> DataReader::parseSampleInfo() {
return make_error_code(llvm::errc::io_error);
}
- return SampleInfo(std::move(Address), Occurrences);
+ return BasicSampleInfo(std::move(Address), Occurrences);
}
ErrorOr<bool> DataReader::maybeParseNoLBRFlag() {
@@ -1094,7 +1094,7 @@ std::error_code DataReader::parseInNoLBRMode() {
if (I == NamesToSamples.end()) {
bool Success;
std::tie(I, Success) = NamesToSamples.insert(std::make_pair(
- Name, FuncSampleData(Name, FuncSampleData::ContainerTy())));
+ Name, FuncBasicSampleData(Name, FuncBasicSampleData::ContainerTy())));
assert(Success && "unexpected result of insert");
}
@@ -1113,11 +1113,11 @@ std::error_code DataReader::parseInNoLBRMode() {
};
while (hasBranchData()) {
- ErrorOr<SampleInfo> Res = parseSampleInfo();
+ ErrorOr<BasicSampleInfo> Res = parseSampleInfo();
if (std::error_code EC = Res.getError())
return EC;
- SampleInfo SI = Res.get();
+ BasicSampleInfo SI = Res.get();
// Ignore samples not involving known locations
if (!SI.Loc.IsSymbol)
@@ -1359,7 +1359,7 @@ DataReader::getMemDataForNames(const std::vector<StringRef> &FuncNames) {
return fetchMapEntry<NamesToMemEventsMapTy>(NamesToMemEvents, FuncNames);
}
-FuncSampleData *
+FuncBasicSampleData *
DataReader::getFuncSampleData(const std::vector<StringRef> &FuncNames) {
return fetchMapEntry<NamesToSamplesMapTy>(NamesToSamples, FuncNames);
}
@@ -1403,9 +1403,9 @@ void DataReader::dump() const {
}
for (const auto &KV : NamesToSamples) {
const StringRef Name = KV.first;
- const FuncSampleData &FSD = KV.second;
+ const FuncBasicSampleData &FSD = KV.second;
Diag << Name << " samples:\n";
- for (const SampleInfo &SI : FSD.Data)
+ for (const BasicSampleInfo &SI : FSD.Data)
Diag << SI.Loc.Name << " " << SI.Loc.Offset << " " << SI.Hits << "\n";
}
diff --git a/bolt/lib/Profile/YAMLProfileReader.cpp b/bolt/lib/Profile/YAMLProfileReader.cpp
index f5636bfe3e1f1..1cdc51aa800a8 100644
--- a/bolt/lib/Profile/YAMLProfileReader.cpp
+++ b/bolt/lib/Profile/YAMLProfileReader.cpp
@@ -181,7 +181,7 @@ bool YAMLProfileReader::parseFunctionProfile(
for (const yaml::bolt::BinaryBasicBlockProfile &YamlBB : YamlBF.Blocks)
for (const yaml::bolt::SuccessorInfo &YamlSI : YamlBB.Successors)
FuncRawBranchCount += YamlSI.Count;
- BF.setRawBranchCount(FuncRawBranchCount);
+ BF.setRawSampleCount(FuncRawBranchCount);
if (BF.empty())
return true;
@@ -221,7 +221,7 @@ bool YAMLProfileReader::parseFunctionProfile(
// Basic samples profile (without LBR) does not have branches information
// and needs a special processing.
- if (YamlBP.Header.Flags & BinaryFunction::PF_SAMPLE) {
+ if (YamlBP.Header.Flags & BinaryFunction::PF_IP) {
if (!YamlBB.EventCount) {
BB.setExecutionCount(0);
continue;
@@ -338,7 +338,7 @@ bool YAMLProfileReader::parseFunctionProfile(
if (BB.getExecutionCount() == BinaryBasicBlock::COUNT_NO_PROFILE)
BB.setExecutionCount(0);
- if (YamlBP.Header.Flags & BinaryFunction::PF_SAMPLE)
+ if (YamlBP.Header.Flags & BinaryFunction::PF_IP)
BF.setExecutionCount(FunctionExecutionCount);
ProfileMatched &= !MismatchedBlocks && !MismatchedCalls && !MismatchedEdges;
diff --git a/bolt/test/X86/branch-data.test b/bolt/test/X86/branch-data.test
index 231a77307ffef..8ff2120bdf967 100644
--- a/bolt/test/X86/branch-data.test
+++ b/bolt/test/X86/branch-data.test
@@ -15,7 +15,7 @@ CHECK: Section : .text
CHECK: IsSimple : 1
CHECK: BB Count : 5
CHECK: Exec Count : 199
-CHECK: Branch Count: 7689
+CHECK: Sample Count: 7689
CHECK: }
CHECK: .LBB{{.*}}
CHECK: Exec Count : 199
diff --git a/bolt/test/X86/reader-stale-yaml-std.test b/bolt/test/X86/reader-stale-yaml-std.test
index 9abe042d0e968..a02928adc80cd 100644
--- a/bolt/test/X86/reader-stale-yaml-std.test
+++ b/bolt/test/X86/reader-stale-yaml-std.test
@@ -24,7 +24,7 @@ CHECK: Section : .text
CHECK: IsSimple : 1
CHECK: BB Count : 18
CHECK: Exec Count : 151
-CHECK: Branch Count: 552
+CHECK: Sample Count: 552
CHECK: }
## Verify block counts.
CHECK: .LBB00 (43 instructions, align : 1)
@@ -51,7 +51,7 @@ CHECK: Section : .text
CHECK: IsSimple : 1
CHECK: BB Count : 5
CHECK: Exec Count : 20
-CHECK: Branch Count: 640
+CHECK: Sample Count: 640
CHECK: }
## Verify block counts.
CHECK: .LBB01 (4 instructions, align : 1)
diff --git a/bolt/test/X86/reader-stale-yaml.test ...
[truncated]
|
Created using spr 1.3.4
Created using spr 1.3.4 [skip ci]
@@ -143,7 +143,7 @@ class BinaryFunction { | |||
enum { | |||
PF_NONE = 0, /// No profile. | |||
PF_LBR = 1, /// Profile is based on last branch records. | |||
PF_SAMPLE = 2, /// Non-LBR sample-based profile. | |||
PF_IP = 2, /// Non-LBR sample-based profile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not PF_BASIC
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought of a concise counterpart to PF_LBR. PF_BASIC would be best matched by PF_BRANCH imo. But I don't feel strongly about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, pending the changes we've discussed offline.
Created using spr 1.3.4 [skip ci]
Created using spr 1.3.4
Sample is a general term covering both basic (IP) and branch (LBR)
profiles. Find and replace ambiguous uses of sample in a basic sample
sense.
Rename
RawBranchCount
intoRawSampleCount
reflecting its use forboth kinds of profile.
Rename
PF_LBR
profile type asPF_BRANCH
reflecting non-LBR basedbranch profiles (non-brstack SPE, synthesized brstack ETM/PT).
Follow-up to #137644.
Test Plan: NFC