[llvm] [memprof] Teach extractCallsFromIR to look into inline stacks (PR #115441)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 10:48:54 PST 2024


================
@@ -824,11 +824,14 @@ memprof::extractCallsFromIR(Module &M) {
           continue;
 
         StringRef CalleeName = CalledFunction->getName();
-        uint64_t CallerGUID =
-            IndexedMemProfRecord::getGUID(DIL->getSubprogramLinkageName());
-        uint64_t CalleeGUID = IndexedMemProfRecord::getGUID(CalleeName);
-        LineLocation Loc = {GetOffset(DIL), DIL->getColumn()};
-        Calls[CallerGUID].emplace_back(Loc, CalleeGUID);
+        do {
+          uint64_t CallerGUID =
+              IndexedMemProfRecord::getGUID(DIL->getSubprogramLinkageName());
----------------
snehasish wrote:

The module debug flags include `debugInfoForProfiling` which we could check too. I don't think we'll be able to do much without the GUIDs (in the first version) so failing in assert mode doesn't sound too bad to me. It's up to you to decide. 

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


More information about the llvm-commits mailing list