Skip to content

Commit 0dc2c79

Browse files
committed
addressing comments
1 parent 15ca43a commit 0dc2c79

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

llvm/lib/Transforms/IPO/SampleProfile.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,9 @@ class SampleProfileMatcher {
455455
Unknown = 32,
456456
};
457457

458-
// For each function, store every callsite a matching state into this map, of
459-
// which each entry is a pair of callsite location and MatchState. This is
460-
// used for profile stalness computation and report.
458+
// For each function, store every callsite and its matching state into this
459+
// map, of which each entry is a pair of callsite location and MatchState.
460+
// This is used for profile staleness computation and report.
461461
StringMap<std::unordered_map<LineLocation, MatchState, LineLocationHash>>
462462
FuncCallsiteMatchStates;
463463

@@ -2416,9 +2416,9 @@ void SampleProfileMatcher::computeCallsiteMatchStates(
24162416

24172417
for (const auto &I : IRAnchors) {
24182418
// In post-match, use the matching result to remap the current IR callsite.
2419-
const auto &Loc = MapIRLocToProfileLoc(I.first);
2419+
const auto &ProfileLoc = MapIRLocToProfileLoc(I.first);
24202420
const auto &IRCalleeName = I.second;
2421-
const auto &It = ProfileAnchors.find(Loc);
2421+
const auto &It = ProfileAnchors.find(ProfileLoc);
24222422
if (It == ProfileAnchors.end())
24232423
continue;
24242424
const auto &Callees = It->second;
@@ -2434,7 +2434,7 @@ void SampleProfileMatcher::computeCallsiteMatchStates(
24342434
IsCallsiteMatched = true;
24352435

24362436
if (IsCallsiteMatched) {
2437-
auto R = CallsiteMatchStates.emplace(Loc, MatchState::Matched);
2437+
auto R = CallsiteMatchStates.emplace(ProfileLoc, MatchState::Matched);
24382438
// When there is an existing state, we know it's in post-match phrase.
24392439
// Update the matching state accordingly.
24402440
if (!R.second) {
@@ -2584,8 +2584,7 @@ void SampleProfileMatcher::computeAndReportProfileStaleness() {
25842584
errs() << "(" << NumStaleProfileFunc << "/" << TotalProfiledFunc << ")"
25852585
<< " of functions' profile are invalid and "
25862586
<< " (" << MismatchedFunctionSamples << "/" << TotalFunctionSamples
2587-
<< ")"
2588-
<< " of samples are discarded due to function hash mismatch.\n";
2587+
<< ") of samples are discarded due to function hash mismatch.\n";
25892588
}
25902589
errs() << "(" << (NumMismatchedCallsites + NumRecoveredCallsites) << "/"
25912590
<< TotalProfiledCallsites << ")"

0 commit comments

Comments
 (0)