[llvm] [SampleProfile] Annotate always inlined function with flattened samples (PR #221157)

Wei Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 10:57:19 PDT 2026


================
@@ -2293,6 +2293,10 @@ bool SampleProfileLoader::runOnFunction(Function &F,
             Samples = &It->second;
         }
       }
+      // Try use flattened profile as a fallback when no profile is found as a
----------------
apolloww wrote:

So the real usecase here is when stale profile causes an always inlined (or inlined everywhere) function to miss sample annotation. This won't happen if the profile is 0-gap.

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


More information about the llvm-commits mailing list