[llvm] [MemProf] Attach value profile metadata to the IR using CalleeGuids. (PR #141164)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Fri May 23 07:52:09 PDT 2025
================
@@ -1209,6 +1209,41 @@ readMemprof(Module &M, Function &F, IndexedInstrProfReader *MemProfReader,
InlinedCallStack)) {
NumOfMemProfMatchedCallSites++;
addCallsiteMetadata(I, InlinedCallStack, Ctx);
+
+ // Check if this is an indirect call and we have GUID information
+ // from CallSiteInfo to attach value profile metadata
+ if (!CalledFunction) {
+ // This is an indirect call, look for CallSites with matching stacks
+ // that have CalleeGuids information
+ for (auto &CS : MemProfRec->CallSites) {
----------------
teresajohnson wrote:
I don't follow why we're looking through all callsite records again after finding a match with a callsite record? Can we extend LocHashToCallSites and save a pointer to the callsite record there so a second search isn't needed?
https://github.com/llvm/llvm-project/pull/141164
More information about the llvm-commits
mailing list