[PATCH] D117356: InstructionCombining: avoid eliding mismatched alloc/free pairs

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 14 14:42:14 PST 2022


jyknight added inline comments.


================
Comment at: llvm/lib/Analysis/MemoryBuiltins.cpp:82
+    {LibFunc_malloc,                            {MallocLike,       1,  0, -1, -1, "malloc"}},
+    {LibFunc_vec_malloc,                        {MallocLike,       1,  0, -1, -1, "malloc"}},
+    {LibFunc_valloc,                            {MallocLike,       1,  0, -1, -1, "malloc"}},
----------------
The vec_malloc/vec_calloc/vec_realloc/vec_free functions look like they should be a distinct family.


================
Comment at: llvm/lib/Analysis/MemoryBuiltins.cpp:100
+    {LibFunc_ZnamSt11align_val_tRKSt9nothrow_t, {MallocLike,       3,  0, -1,  1, "_ZnamSt11align_val_t"}}, // new[](unsigned long, align_val_t, nothrow)
+    {LibFunc_msvc_new_int,                      {OpNewLike,        1,  0, -1, -1, "msvc_new_int"}},        // new(unsigned int)
+    {LibFunc_msvc_new_int_nothrow,              {MallocLike,       2,  0, -1, -1, "msvc_new_int"}},        // new(unsigned int, nothrow)
----------------
These aren't good family names, since they could be the name of a user-defined function (and aren't actually what the msvc functions are called).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117356/new/

https://reviews.llvm.org/D117356



More information about the llvm-commits mailing list