[PATCH] D87984: [BuildLibCalls] Add noundef to the returned pointers of allocators and argument of free

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 20 02:13:33 PDT 2020


aqjune created this revision.
aqjune added reviewers: jdoerfert, efriedma, eugenis, guiand.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
aqjune requested review of this revision.

This patch adds noundef to the returned pointers of allocators (malloc, calloc, ...)
and the pointer argument of free.
The returned pointer of allocators cannot be poison or (partially) undef.
Since the pointer that is given to free should precisely have zero offset,
it cannot be poison or (partially) undef too.

For the size arguments of allocators, noundef wasn't attached simply because
I wasn't sure whether attaching it is okay or not.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87984

Files:
  llvm/lib/Transforms/Utils/BuildLibCalls.cpp
  llvm/test/Transforms/InferFunctionAttrs/annotate.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87984.293010.patch
Type: text/x-patch
Size: 5976 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200920/768e0c1a/attachment.bin>


More information about the llvm-commits mailing list