[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 11:01:42 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 see, so this change really does 2 things -- optimize when hot hints are used and allow disabling them altogether. The description now makes more sense to me. Could you commit this as two separate changes -- adding the flag and the optimization (conversion to notcold)? For the former it would be good to have a small test for the flag usage.
https://github.com/llvm/llvm-project/pull/124219
More information about the llvm-commits
mailing list