[all-commits] [llvm/llvm-project] 2cc0c0: [MemProf] Recognize hot/cold operator new as repla...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Mon May 1 13:37:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2cc0c0de802178dc7e5408497e2ec53b6c9728fa
      https://github.com/llvm/llvm-project/commit/2cc0c0de802178dc7e5408497e2ec53b6c9728fa
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2023-05-01 (Mon, 01 May 2023)

  Changed paths:
    M clang/lib/AST/Decl.cpp
    A clang/test/CodeGenCXX/new_hot_cold.cpp

  Log Message:
  -----------
  [MemProf] Recognize hot/cold operator new as replaceable allocations

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 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) and
added support in this patch to recognize it in clang.

Differential Revision: https://reviews.llvm.org/D149600




More information about the All-commits mailing list