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

Lei Wang via flang-commits flang-commits at lists.llvm.org
Mon Jan 29 11:02:18 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) {
----------------
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


More information about the flang-commits mailing list