[llvm] [MemProf] Allow hint update on existing calls to nobuiltin hot/cold new (PR #156476)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 2 09:14:09 PDT 2025


================
@@ -1719,6 +1719,37 @@ Value *LibCallSimplifier::optimizeRealloc(CallInst *CI, IRBuilderBase &B) {
   return nullptr;
 }
 
+// Allow existing calls to operator new() that takes a __hot_cold_t parameter to
+// be updated with a compiler-determined hot cold hint value. This is used in
+// cases where the call is marked nobuiltin (because operator new called
+// explicitly) and therefore cannot be replaced with a different callee.
----------------
teresajohnson wrote:

C++ standard: There's a reference to that here: https://clang.llvm.org/docs/LanguageExtensions.html#builtin-operator-new-and-builtin-operator-delete. I see some older conversations about this from Richard Smith. 

https://github.com/llvm/llvm-project/pull/156476


More information about the llvm-commits mailing list