[PATCH] D123053: MemoryBuiltins: only claim an allocator family on builtin functions

Augie Fackler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 4 10:45:56 PDT 2022


durin42 created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
durin42 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This lines up with other parts of the codebase that only use special
knowledge about allocator functions if they're builtins.

Depends on D119582 <https://reviews.llvm.org/D119582>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123053

Files:
  llvm/lib/Analysis/MemoryBuiltins.cpp


Index: llvm/lib/Analysis/MemoryBuiltins.cpp
===================================================================
--- llvm/lib/Analysis/MemoryBuiltins.cpp
+++ llvm/lib/Analysis/MemoryBuiltins.cpp
@@ -500,7 +500,7 @@
                                               const TargetLibraryInfo *TLI) {
   bool IsNoBuiltin;
   const Function *Callee = getCalledFunction(I, IsNoBuiltin);
-  if (Callee == nullptr)
+  if (Callee == nullptr || IsNoBuiltin)
     return None;
   LibFunc TLIFn;
   if (!TLI || !TLI->getLibFunc(*Callee, TLIFn) || !TLI->has(TLIFn))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123053.420236.patch
Type: text/x-patch
Size: 549 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220404/7b1c8ffd/attachment.bin>


More information about the llvm-commits mailing list