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

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 10:49:28 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);
----------------
teresajohnson wrote:

By default hot hint generation is off, however, since it is still optionally supported this avoids a big overhead increase if that is re-enabled for experimentation etc. If we keep that support here, even if optional, I want to ensure things keep working the same.

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


More information about the llvm-commits mailing list