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

Lei Wang via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 29 11:02:18 PST 2024


================
@@ -433,6 +433,44 @@ using CandidateQueue =
     PriorityQueue<InlineCandidate, std::vector<InlineCandidate>,
                   CandidateComparer>;
 
+// Profile matching statstics.
+class ProfileMatchStats {
+  const Module &M;
+  SampleProfileReader &Reader;
+  const PseudoProbeManager *ProbeManager;
+
+public:
+  ProfileMatchStats(const Module &M, SampleProfileReader &Reader,
+                    const PseudoProbeManager *ProbeManager)
+      : M(M), Reader(Reader), ProbeManager(ProbeManager) {}
+
+  uint64_t NumMismatchedCallsites = 0;
+  uint64_t TotalProfiledCallsites = 0;
+  uint64_t MismatchedCallsiteSamples = 0;
+  uint64_t NumMismatchedFuncHash = 0;
+  uint64_t TotalProfiledFunc = 0;
+  uint64_t MismatchedFuncHashSamples = 0;
----------------
wlei-llvm wrote:

Sounds good to remove the "Hash"

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


More information about the libcxx-commits mailing list