[llvm] [MemProf] Disable hot hints by default, otherwise convert to NotCold (PR #124219)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 09:06:44 PST 2025


================
@@ -301,6 +316,22 @@ bool CallStackTrie::buildAndAttachMIBMetadata(CallBase *CI) {
                                 "single");
     return false;
   }
+  // If there were any hot allocation contexts, the Alloc trie node would have
+  // the Hot type set. If so, because we don't currently support cloning for hot
+  // contexts, they should be converted to NotCold. This happens in the cloning
+  // support anyway, however, doing this now enables more aggressive context
+  // trimming when building the MIB metadata (and possibly may make the
+  // allocation have a single NotCold allocation type), greatly reducing
+  // overheads in bitcode, cloning memory and cloning time.
+  if (Alloc->AllocTypes & static_cast<uint8_t>(AllocationType::Hot)) {
+    convertHotToNotCold(Alloc);
----------------
snehasish wrote:

I'm not clear on why we need this. If we set `MemProfUseHotHints` to false, then no alloctypes should have hot type and we'll never enter this condition?

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


More information about the llvm-commits mailing list