[PATCH] D149600: [MemProf] Recognize hot/cold operator new as replaceable allocations

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 1 11:10:40 PDT 2023


tejohnson created this revision.
tejohnson added reviewers: rsmith, snehasish.
Herald added a project: All.
tejohnson requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Follow up to LLVM-side change to allow conversion to hot/cold hinted
operator new, not yet standard but supported by open source tcmalloc.
The LLVM change in a35206d78280e0ebcf48cd21bc5fff5c3b9c73fa <https://reviews.llvm.org/rGa35206d78280e0ebcf48cd21bc5fff5c3b9c73fa> added the
necessary support to recognize these as library functions, and we
subsequently found that a clang-side change is needed to give them
builtin/nobuiltin attributes as appropriate so they have consistent
removeability.

Based on discussion with Richard Smith, converted the parameter type to
a reserved identifier (39f7b48671dae5fbe3afc49f33f50c2b6340bb89 <https://reviews.llvm.org/rG39f7b48671dae5fbe3afc49f33f50c2b6340bb89>) and
added support in this patch to recognize it in clang.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149600

Files:
  clang/lib/AST/Decl.cpp
  clang/test/CodeGenCXX/new_hot_cold.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149600.518494.patch
Type: text/x-patch
Size: 9223 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230501/76221797/attachment.bin>


More information about the llvm-commits mailing list