[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


================
@@ -222,6 +228,15 @@ void CallStackTrie::collectContextSizeInfo(
     collectContextSizeInfo(Caller.second, ContextSizeInfo);
 }
 
+void CallStackTrie::convertHotToNotCold(CallStackTrieNode *Node) {
+  if (Node->AllocTypes & static_cast<uint8_t>(AllocationType::Hot)) {
+    Node->AllocTypes &= ~static_cast<uint8_t>(AllocationType::Hot);
+    Node->AllocTypes |= static_cast<uint8_t>(AllocationType::NotCold);
----------------
snehasish wrote:

Can we add some helpers to Node so that we don't have to sprinkle static_cast and bit masking operations in different places?

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


More information about the llvm-commits mailing list