[llvm] [MemProf] Prune unneeded non-cold contexts (PR #124823)
Snehasish Kumar via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 28 15:19:53 PST 2025
================
@@ -337,10 +371,16 @@ bool CallStackTrie::buildAndAttachMIBMetadata(CallBase *CI) {
MIBCallStack.push_back(AllocStackId);
std::vector<Metadata *> MIBNodes;
assert(!Alloc->Callers.empty() && "addCallStack has not been called yet");
- // The last parameter is meant to say whether the callee of the given node
- // has more than one caller. Here the node being passed in is the alloc
- // and it has no callees. So it's false.
- if (buildMIBNodes(Alloc, Ctx, MIBCallStack, MIBNodes, false)) {
+ // The CalleeHasAmbiguousCallerContext flag is meant to say whether the
+ // callee of the given node has more than one caller. Here the node being
+ // passed in is the alloc and it has no callees. So it's false.
+ // Similarly, the last parameter is meant to say whether the callee of the
+ // given node is the deepest point where we have ambiguous alloc types, which
+ // is also false as the alloc has no callees.
+ bool DeepestAmbiguousAllocType = true;
----------------
snehasish wrote:
If we change buildMIBNodes to take a pointer to a bool instead of a reference (defaulting to nullptr) then we can avoid the change (and redundant var) here. Inside buildMIBNodes we'd check and fill in the bool only if the pointer was not null. Wdyt?
https://github.com/llvm/llvm-project/pull/124823
More information about the llvm-commits
mailing list