mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
[llvm-profdata] Add overlap command to compute similarity b/w two profile files
Add overlap functionality to llvm-profdata tool to compute the similarity between two profile files. Differential Revision: https://reviews.llvm.org/D60977 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359612 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -900,3 +900,17 @@ Error IndexedInstrProfReader::readNextRecord(NamedInstrProfRecord &Record) {
|
||||
}
|
||||
return success();
|
||||
}
|
||||
|
||||
void InstrProfReader::accumuateCounts(CountSumOrPercent &Sum, bool IsCS) {
|
||||
uint64_t NumFuncs = 0;
|
||||
for (const auto &Func : *this) {
|
||||
if (isIRLevelProfile()) {
|
||||
bool FuncIsCS = NamedInstrProfRecord::hasCSFlagInHash(Func.Hash);
|
||||
if (FuncIsCS != IsCS)
|
||||
continue;
|
||||
}
|
||||
Func.accumuateCounts(Sum);
|
||||
++NumFuncs;
|
||||
}
|
||||
Sum.NumEntries = NumFuncs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user