[all-commits] [llvm/llvm-project] 7a7dc7: [SampleProfile] Preserve first stale profile CG match
Yuxuan Chen via All-commits
all-commits at lists.llvm.org
Sat Jul 11 22:29:46 PDT 2026
Branch: refs/heads/users/yuxuanchen1997/fix-stale-profile-anchor-overwrite
Home: https://github.com/llvm/llvm-project
Commit: 7a7dc7ddebe6b6fa1a06c25378262f084bc700bd
https://github.com/llvm/llvm-project/commit/7a7dc7ddebe6b6fa1a06c25378262f084bc700bd
Author: Yuxuan Chen <ych at meta.com>
Date: 2026-07-10 (Fri, 10 Jul 2026)
Changed paths:
M llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp
A llvm/test/Transforms/SampleProfile/Inputs/pseudo-probe-stale-profile-lcs-anchor-overwrite.prof
A llvm/test/Transforms/SampleProfile/pseudo-probe-stale-profile-lcs-anchor-overwrite.ll
Log Message:
-----------
[SampleProfile] Preserve first stale profile CG match
During stale profile LCS matching, the matcher may compare the same IR function against multiple profile candidates. This can happen for overloads that share a demangled basename. The comparison result is useful for the current LCS, but rewriting FuncToProfileNameMap on every successful comparison can replace the profile selected for an IR function with a later candidate.
If another IR function is also matched to that later candidate, both functions can end up using the same stale CFG location map and runStaleProfileMatching asserts that the map is already populated.
Preserve the first selected profile mapping with try_emplace while still caching each pairwise comparison result. Add a regression with a minimal sample profile that used to trigger the assertion.
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