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

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 22:23:09 PDT 2025


================
@@ -168,7 +187,8 @@ void CallStackTrie::addCallStack(MDNode *MIB) {
 static MDNode *createMIBNode(LLVMContext &Ctx, ArrayRef<uint64_t> MIBCallStack,
                              AllocationType AllocType,
                              ArrayRef<ContextTotalSize> ContextSizeInfo,
-                             uint64_t &TotalBytes, uint64_t &ColdBytes) {
+                             uint64_t &TotalBytes, uint64_t &ColdBytes,
----------------
snehasish wrote:

It's a bit strange to have output params (Total bytes and ColdBytes) appear before MaxColdSize which is an input. Maybe change the order to have the inputs first? Also const for MaxColdSize.

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


More information about the llvm-commits mailing list