[llvm] [memprof] Teach extractCallsFromIR to look into inline stacks (PR #115441)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 8 05:55:53 PST 2024
================
@@ -824,11 +824,22 @@ 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);
+ if (DIL->getInlinedAt()) {
+ for (; DIL; DIL = DIL->getInlinedAt()) {
----------------
teresajohnson wrote:
Can we simply do this loop in both cases (with and without a getInlinedAt())? In the case of no getInlinedAt() afaict this would execute once and do the same thing as the else case further below.
https://github.com/llvm/llvm-project/pull/115441
More information about the llvm-commits
mailing list