[PATCH] D71521: Support for library function aligned_alloc

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 14 21:26:22 PST 2019


bondhugula created this revision.
bondhugula added reviewers: jdoerfert, xbolva00.
bondhugula added a project: LLVM.
Herald added subscribers: llvm-commits, hiraditya.

aligned_alloc is a standard lib function and has been in glibc since 2.16 and in the C11 standard. It has semantics similar to malloc/calloc for several analyses/transforms. This change will also be useful to LLVM generators that need to allocate buffers of vector elements larger than 16 bytes (for eg. 256-bit ones), element boundary alignment for which is not typically provided by malloc.

  
  - update target library info
  - update passes to be aware of aligned_alloc in ways similar to malloc,
    calloc, etc.


https://reviews.llvm.org/D71521

Files:
  llvm/include/llvm/Analysis/MemoryBuiltins.h
  llvm/include/llvm/Analysis/TargetLibraryInfo.def
  llvm/lib/Analysis/BasicAliasAnalysis.cpp
  llvm/lib/Analysis/MemoryBuiltins.cpp
  llvm/lib/Analysis/TargetLibraryInfo.cpp
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/lib/Transforms/Scalar/GVN.cpp
  llvm/lib/Transforms/Scalar/NewGVN.cpp
  llvm/lib/Transforms/Utils/BuildLibCalls.cpp
  llvm/test/Transforms/Attributor/heap_to_stack.ll
  llvm/test/Transforms/DeadStoreElimination/simple.ll
  llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
  llvm/test/Transforms/InstCombine/malloc-free-delete.ll
  llvm/unittests/Analysis/TargetLibraryInfoTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71521.233952.patch
Type: text/x-patch
Size: 20217 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191215/2fab699e/attachment.bin>


More information about the llvm-commits mailing list