[libc] [lld] [llvm] [compiler-rt] [libcxx] [flang] [clang-tools-extra] [libcxxabi] [clang] [CSSPGO] Compute and report post-match profile staleness (PR #79090)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 27 10:40:08 PST 2024


================
@@ -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) {
----------------
WenleiHe wrote:

This is the place where pre-match and post-match is automatically handled in unified way, right? 

https://github.com/llvm/llvm-project/pull/79090


More information about the cfe-commits mailing list