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

Augie Fackler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 26 11:01:04 PST 2022


durin42 marked an inline comment as done.
durin42 added inline comments.


================
Comment at: llvm/lib/Analysis/MemoryBuiltins.cpp:116
 // know which functions are nounwind, noalias, nocapture parameters, etc.
 static const std::pair<LibFunc, AllocFnsTy> AllocationFnData[] = {
+    {LibFunc_malloc,                            {MallocLike,       1,  0, -1, -1, MallocFamily::Malloc}},
----------------
xbolva00 wrote:
> Anyway I still think Clang should add attributes and metadata as more general solution wrt this hardcoded list.
Yes, that's part of where we're going. I'm not comfortable promising this table goes away entirely, but in general I think most of it should be able to disappear. I need all of this to be in attributes so that it's usable from out-of-tree consumers, like Rust (which is what motivates this work), so you can count on me getting at least as far as making it all _doable_ via attributes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117356



More information about the llvm-commits mailing list