[flang-commits] [libcxxabi] [clang] [compiler-rt] [lld] [llvm] [libc] [libcxx] [clang-tools-extra] [flang] [CSSPGO] Compute and report post-match profile staleness (PR #79090)
via flang-commits
flang-commits at lists.llvm.org
Wed Jan 24 14:28:20 PST 2024
================
@@ -2422,59 +2342,226 @@ void SampleProfileMatcher::runStaleProfileMatching(
}
}
-void SampleProfileMatcher::runOnFunction(const Function &F) {
- // We need to use flattened function samples for matching.
- // Unlike IR, which includes all callsites from the source code, the callsites
- // in profile only show up when they are hit by samples, i,e. the profile
- // callsites in one context may differ from those in another context. To get
- // the maximum number of callsites, we merge the function profiles from all
- // contexts, aka, the flattened profile to find profile anchors.
- const auto *FSFlattened = getFlattenedSamplesFor(F);
- if (!FSFlattened)
- return;
+void SampleProfileMatcher::runStaleProfileMatching() {
+ for (const auto &F : M) {
+ if (F.isDeclaration() || !F.hasFnAttribute("use-sample-profile"))
----------------
WenleiHe wrote:
This particular check is duplicated now because we turned `runOnFunction` into `runOnModule`. Maybe make a small helper to centralize this check and keep them always in sync for the different function loops.
https://github.com/llvm/llvm-project/pull/79090
More information about the flang-commits
mailing list