[all-commits] [llvm/llvm-project] c98da3: [CSSPGO] Compute and report profile matching recov...
Lei Wang via All-commits
all-commits at lists.llvm.org
Mon Feb 19 11:36:32 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c98da372cb08cd3b3c513a6a86592b0f2892fb49
https://github.com/llvm/llvm-project/commit/c98da372cb08cd3b3c513a6a86592b0f2892fb49
Author: Lei Wang <wlei at fb.com>
Date: 2024-02-19 (Mon, 19 Feb 2024)
Changed paths:
M llvm/lib/Transforms/IPO/SampleProfile.cpp
M llvm/test/Transforms/SampleProfile/Inputs/profile-mismatch.prof
M llvm/test/Transforms/SampleProfile/Inputs/pseudo-probe-profile-mismatch.prof
M llvm/test/Transforms/SampleProfile/profile-mismatch.ll
M llvm/test/Transforms/SampleProfile/pseudo-probe-profile-mismatch-thinlto.ll
M llvm/test/Transforms/SampleProfile/pseudo-probe-profile-mismatch.ll
Log Message:
-----------
[CSSPGO] Compute and report profile matching recovered callsites and samples (#79090)
This change adds the support to compute and report the staleness metrics
after stale profile matching so that we can know how effective the fuzzy
matching is, i. e. how many callsites and samples are recovered by the
matching.
Some implementation notes:
- The function checksum mismatch metrics are not applicable here as it's
function-level metrics, checksum mismatch remains the same before and
after matching, so we need to compute based on the callsite samples.
- Added two new counters `NumRecoveredCallsites`,
`RecoveredCallsiteSamples` for this and removed `TotalCallsiteSamples`
as now the we can use the `TotalFuncHashSamples` as base, and renamed
some counters.
- In profile matching, we changed to use a state machine to represent
the callsite's matching state changes. See the `MatchState` for the
state, and used a new function `recordCallsiteMatchStates` to compute
and record the callsite's match states changes before and after the
matching, , the result is compressed and saved into a
`FuncCallsiteMatchStates` map for later counting use.
- Changed the counting function to run on module-level and moved it to
the end of the whole process(`computeAndReportProfileStaleness`). The
reason is before the callsite is only counted on top-level function,
this change extends it to count(recursively) on the inlined functions
and samples, which is more accurate.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list