Repository navigation
Mark TCMalloc hot/cold allocation entry points with ABSL_ATTRIBUTE_HOT. - #1987
Merged
Merged
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
copybara-service
Bot
force-pushed
the
test_982514531
branch
from
December 5, 2026 15:51
b3c0c29 to
ddadf2e
Compare
TCMalloc's `__hot_cold_t` allocation entry points only receive traffic when MemProf hot/cold hinting is enabled. Instrumentation FDO binaries build without MemProf, and AutoFDO profiles can predate MemProf enablement, so both can record zero counts for these entry points. Optimizers then treat them as cold, applying cold-function heuristics such as disabling tail-call elimination on allocation fast paths. LLVM's `ProfileSummaryInfo` now honors the `hot` function attribute over profile counts (llvm/llvm-project@be7aacd). Annotate all `__hot_cold_t` allocation entry points in `tcmalloc.cc` with `ABSL_ATTRIBUTE_HOT` so they stay hot even when unexecuted in the profile. This covers the `operator new` and `operator new[]` overloads, `TCMallocInternalNew*HotCold*` functions, size-returning hot/cold functions, and `DEFINE_ALLOC_TOKEN_NEW_EXTENSION` variants. PiperOrigin-RevId: 1037097974
copybara-service
Bot
force-pushed
the
test_982514531
branch
from
December 5, 2026 16:03
ddadf2e to
c50cc42
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mark TCMalloc hot/cold allocation entry points with ABSL_ATTRIBUTE_HOT.
TCMalloc's
__hot_cold_tallocation entry points only receive traffic when MemProf hot/cold hinting is enabled. Instrumentation FDO binaries build without MemProf, and AutoFDO profiles can predate MemProf enablement, so both can record zero counts for these entry points. Optimizers then treat them as cold, applying cold-function heuristics such as disabling tail-call elimination on allocation fast paths.LLVM's
ProfileSummaryInfonow honors thehotfunction attribute over profile counts (llvm/llvm-project@be7aacd). Annotate all__hot_cold_tallocation entry points intcmalloc.ccwithABSL_ATTRIBUTE_HOTso they stay hot even when unexecuted in the profile. This covers theoperator newandoperator new[]overloads,TCMallocInternalNew*HotCold*functions, size-returning hot/cold functions, andDEFINE_ALLOC_TOKEN_NEW_EXTENSIONvariants.