[llvm] [MemProf] Fix when CallStackTrie is a single chain with multi alloc type (PR #79433)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 05:14:51 PST 2024


================
@@ -244,12 +244,17 @@ bool CallStackTrie::buildAndAttachMIBMetadata(CallBase *CI) {
   MIBCallStack.push_back(AllocStackId);
   std::vector<Metadata *> MIBNodes;
   assert(!Alloc->Callers.empty() && "addCallStack has not been called yet");
-  buildMIBNodes(Alloc, Ctx, MIBCallStack, MIBNodes,
-                /*CalleeHasAmbiguousCallerContext=*/true);
-  assert(MIBCallStack.size() == 1 &&
-         "Should only be left with Alloc's location in stack");
-  CI->setMetadata(LLVMContext::MD_memprof, MDNode::get(Ctx, MIBNodes));
-  return true;
+  if (buildMIBNodes(Alloc, Ctx, MIBCallStack, MIBNodes, false)) {
----------------
teresajohnson wrote:

Document const parameter (i.e. like it currently is at head but with false instead of true).

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


More information about the llvm-commits mailing list