================ @@ -2205,93 +2230,141 @@ void SampleProfileMatcher::countMismatchedSamples(const FunctionSamples &FS) { countMismatchedSamples(CS.second); } -void SampleProfileMatcher::countProfileMismatches( - const Function &F, const FunctionSamples &FS, - const std::map<LineLocation, StringRef> &IRAnchors, +void ProfileMatchStats::countMismatchedCallsites( + const Function &F, const std::map<LineLocation, StringRef> &IRAnchors, + const std::map<LineLocation, std::unordered_set<FunctionId>> + &ProfileAnchors, + const LocToLocMap &IRToProfileLocationMap) { + auto &MismatchedCallsites = + FuncMismatchedCallsites[FunctionSamples::getCanonicalFnName(F.getName())]; + + auto MapIRLocToProfileLoc = [&](const LineLocation &IRLoc) { ---------------- wlei-llvm wrote:
Yep, the benefit here is pre-match and post-match using the same function`countMismatchedCallsites`, no special process to parsing the matching results. For pre-match, we just pass a empty `IRToProfileLocationMap` and no changes to `RunStaleProfileMatching`. https://github.com/llvm/llvm-project/pull/79090 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits