[MemProf] Optionally pass hot/cold hints to operator new
authorTeresa Johnson <tejohnson@google.com>
Wed, 19 Apr 2023 15:21:52 +0000 (08:21 -0700)
committerTeresa Johnson <tejohnson@google.com>
Wed, 19 Apr 2023 20:33:46 +0000 (13:33 -0700)
commita35206d78280e0ebcf48cd21bc5fff5c3b9c73fa
treee128be8e1d26a72fe3accdbcbd6957e3f785ebb1
parent24214832fd433a901c2296088bf23b7bc86c6a96
[MemProf] Optionally pass hot/cold hints to operator new

Optionally (off by default) replace operator new() calls marked with a
hot or cold memprof attribute with an operator new() call that takes a
hot_cold_t parameter.

Currently this is supported by the open source version of tcmalloc, see:
https://github.com/google/tcmalloc/blob/master/tcmalloc/new_extension.h

Differential Revision: https://reviews.llvm.org/D148718
llvm/include/llvm/Analysis/TargetLibraryInfo.def
llvm/include/llvm/Transforms/Utils/BuildLibCalls.h
llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
llvm/lib/Analysis/MemoryBuiltins.cpp
llvm/lib/Analysis/TargetLibraryInfo.cpp
llvm/lib/Transforms/Utils/BuildLibCalls.cpp
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/Transforms/InstCombine/simplify-libcalls-new.ll [new file with mode: 0644]
llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
llvm/unittests/Analysis/TargetLibraryInfoTest.cpp