Skip to content

Commit

Permalink
[PGO] Fix typos from r359612. NFC.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373369 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
xur-llvm committed Oct 1, 2019
1 parent 92d26cb commit fb38a0e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions include/llvm/ProfileData/InstrProf.h
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,8 @@ struct OverlapStats {
FuncHash = Hash;
}

Error accumuateCounts(const std::string &BaseFilename,
const std::string &TestFilename, bool IsCS);
Error accumulateCounts(const std::string &BaseFilename,
const std::string &TestFilename, bool IsCS);
void addOneMismatch(const CountSumOrPercent &MismatchFunc);
void addOneUnique(const CountSumOrPercent &UniqueFunc);

Expand Down Expand Up @@ -768,7 +768,7 @@ struct InstrProfRecord {
void clearValueData() { ValueData = nullptr; }

/// Compute the sums of all counts and store in Sum.
void accumuateCounts(CountSumOrPercent &Sum) const;
void accumulateCounts(CountSumOrPercent &Sum) const;

/// Compute the overlap b/w this IntrprofRecord and Other.
void overlap(InstrProfRecord &Other, OverlapStats &Overlap,
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/ProfileData/InstrProfReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class InstrProfReader {
virtual InstrProfSymtab &getSymtab() = 0;

/// Compute the sum of counts and return in Sum.
void accumuateCounts(CountSumOrPercent &Sum, bool IsCS);
void accumulateCounts(CountSumOrPercent &Sum, bool IsCS);

protected:
std::unique_ptr<InstrProfSymtab> Symtab;
Expand Down
12 changes: 6 additions & 6 deletions lib/ProfileData/InstrProf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ Error readPGOFuncNameStrings(StringRef NameStrings, InstrProfSymtab &Symtab) {
return Error::success();
}

void InstrProfRecord::accumuateCounts(CountSumOrPercent &Sum) const {
void InstrProfRecord::accumulateCounts(CountSumOrPercent &Sum) const {
uint64_t FuncSum = 0;
Sum.NumEntries += Counts.size();
for (size_t F = 0, E = Counts.size(); F < E; ++F)
Expand Down Expand Up @@ -552,7 +552,7 @@ void InstrProfRecord::overlap(InstrProfRecord &Other, OverlapStats &Overlap,
uint64_t ValueCutoff) {
// FuncLevel CountSum for other should already computed and nonzero.
assert(FuncLevelOverlap.Test.CountSum >= 1.0f);
accumuateCounts(FuncLevelOverlap.Base);
accumulateCounts(FuncLevelOverlap.Base);
bool Mismatch = (Counts.size() != Other.Counts.size());

// Check if the value profiles mismatch.
Expand Down Expand Up @@ -1164,17 +1164,17 @@ void createProfileFileNameVar(Module &M, StringRef InstrProfileOutput) {
}
}

Error OverlapStats::accumuateCounts(const std::string &BaseFilename,
const std::string &TestFilename,
bool IsCS) {
Error OverlapStats::accumulateCounts(const std::string &BaseFilename,
const std::string &TestFilename,
bool IsCS) {
auto getProfileSum = [IsCS](const std::string &Filename,
CountSumOrPercent &Sum) -> Error {
auto ReaderOrErr = InstrProfReader::create(Filename);
if (Error E = ReaderOrErr.takeError()) {
return E;
}
auto Reader = std::move(ReaderOrErr.get());
Reader->accumuateCounts(Sum, IsCS);
Reader->accumulateCounts(Sum, IsCS);
return Error::success();
};
auto Ret = getProfileSum(BaseFilename, Base);
Expand Down
4 changes: 2 additions & 2 deletions lib/ProfileData/InstrProfReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,15 +907,15 @@ Error IndexedInstrProfReader::readNextRecord(NamedInstrProfRecord &Record) {
return success();
}

void InstrProfReader::accumuateCounts(CountSumOrPercent &Sum, bool IsCS) {
void InstrProfReader::accumulateCounts(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);
Func.accumulateCounts(Sum);
++NumFuncs;
}
Sum.NumEntries = NumFuncs;
Expand Down
2 changes: 1 addition & 1 deletion lib/ProfileData/InstrProfWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void InstrProfWriter::overlapRecord(NamedInstrProfRecord &&Other,
const OverlapFuncFilters &FuncFilter) {
auto Name = Other.Name;
auto Hash = Other.Hash;
Other.accumuateCounts(FuncLevelOverlap.Test);
Other.accumulateCounts(FuncLevelOverlap.Test);
if (FunctionData.find(Name) == FunctionData.end()) {
Overlap.addOneUnique(FuncLevelOverlap.Test);
return;
Expand Down
2 changes: 1 addition & 1 deletion tools/llvm-profdata/llvm-profdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ static void overlapInstrProfile(const std::string &BaseFilename,
WriterContext Context(false, ErrorLock, WriterErrorCodes);
WeightedFile WeightedInput{BaseFilename, 1};
OverlapStats Overlap;
Error E = Overlap.accumuateCounts(BaseFilename, TestFilename, IsCS);
Error E = Overlap.accumulateCounts(BaseFilename, TestFilename, IsCS);
if (E)
exitWithError(std::move(E), "Error in getting profile count sums");
if (Overlap.Base.CountSum < 1.0f) {
Expand Down

0 comments on commit fb38a0e

Please sign in to comment.