[llvm] [SampleFDO] Don't report an IR indirect call vs. a profiled direct call as a callsite mismatch (PR #220126)

Wei Wang via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 17:47:01 PDT 2026


================
@@ -523,7 +523,14 @@ void SampleProfileMatcher::recordCallsiteMatchStates(
     if (It == ProfileAnchors.end())
       continue;
     const auto &ProfCalleeId = It->second;
-    if (IRCalleeId == ProfCalleeId) {
+    // An IR indirect callsite is considered matched with whatever callee the
+    // profile records at the same location. When only one of the call targets
+    // is sampled, the profile records the indirect call like a direct call, so
+    // the differing callee names don't imply a stale location. This is not a
+    // perf issue either: the samples are attributed to the promoted callee
+    // once the callsite is transformed by ICP.
+    if (IRCalleeId == ProfCalleeId ||
----------------
apolloww wrote:

Yes. Closing this now.

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


More information about the llvm-commits mailing list