[PATCH] D76970: Support for library function aligned_alloc in TLI / memory builtins

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 23:25:40 PDT 2020


bondhugula created this revision.
bondhugula added reviewers: jdoerfert, xbolva00.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
bondhugula updated this revision to Diff 253296.
bondhugula added a comment.
bondhugula updated this revision to Diff 253297.

clang-format missed changes


bondhugula added a comment.

Fix inadvertent format changes


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 patch introduces aligned_alloc
in target library info and memory builtins. Subsequent ones will
make other passes aware and fix https://bugs.llvm.org/show_bug.cgi?id=44062

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 glibc malloc.

Signed-off-by: Uday Bondhugula <uday at polymagelabs.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76970

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/Utils/BuildLibCalls.cpp
  llvm/test/Transforms/DeadStoreElimination/simple.ll
  llvm/unittests/Analysis/TargetLibraryInfoTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76970.253297.patch
Type: text/x-patch
Size: 7143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200328/27329614/attachment.bin>


More information about the llvm-commits mailing list