[llvm] [MemProf] Optionally save context size info on largest cold allocations (PR #142507)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 3 09:15:07 PDT 2025


================
@@ -558,7 +559,21 @@ static void computeFunctionSummary(
                                 ->getZExtValue();
               ContextSizes.push_back({FullStackId, TS});
             }
+            // The ContextSizeInfos must be in the same relative position as the
+            // associated MIB. In some cases we only include a ContextSizeInfo
+            // for a subset of MIBs in an allocation. In those cases we insert
+            // 0s for the other MIBs. Handle the case where the first
+            // ContextSizeInfo being inserted is not for the first MIB, insert
+            // a pair of 0s for each of the prior MIBs.
+            if (ContextSizeInfos.empty() && !MIBs.empty())
----------------
snehasish wrote:

sgtm.

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


More information about the llvm-commits mailing list