[llvm] [CSSPGO] Compute and report profile matching recovered callsites and samples (PR #79090)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 13:29:49 PST 2024


================
@@ -444,15 +444,34 @@ class SampleProfileMatcher {
   // the profile.
   StringMap<LocToLocMap> FuncMappings;
 
-  // Profile mismatching statstics.
+  // Match state for an anchor/callsite.
+  enum class MatchState {
+    Matched = 0,
+    Mismatched = 0x1,
+    Recovered = 0x1,
+  };
+
+  // For each function, store every callsite state into a map, of which each
+  // entry is a pair of callsite location and MatchState. This is used for
+  // profile stalness computation and report.
+  StringMap<std::unordered_map<LineLocation, MatchState, LineLocationHash>>
+      FuncCallsiteMatchStates;
+
+  /// Profile mismatch statstics:
+  uint64_t TotalProfiledFunc = 0;
+  // Num of function whose checksum is mismatched.
+  uint64_t NumMismatchedFunc = 0;
----------------
WenleiHe wrote:

Or maybe we can defer that until when we handle function renaming and do call graph level matching -- that's where we need to know how many of the no profile functions we are able to recover profile for them.



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


More information about the llvm-commits mailing list