[llvm] [MemProf] Fix reporting with -memprof-matching-cold-threshold (PR #173327)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 23 22:18:39 PST 2025


================
@@ -75,8 +75,9 @@ class CallStackTrie {
     // If the user has requested reporting of hinted sizes, keep track of the
     // associated full stack id and profiled sizes. Can have more than one
     // after trimming (e.g. when building from metadata). This is only placed on
-    // the last (root-most) trie node for each allocation context.
-    std::vector<ContextTotalSize> ContextSizeInfo;
+    // the last (root-most) trie node for each allocation context. Also
+    // track the original allocation type of the context.
+    std::vector<std::pair<ContextTotalSize, AllocationType>> ContextInfo;
----------------
snehasish wrote:

Let's define a new type alias for this pair and then document the reason why it's a pair instead of adding the allocation type into the context total size struct?

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


More information about the llvm-commits mailing list