This is an archive of the discontinued LLVM Phabricator instance.

Support for library function aligned_alloc in TLI / memory builtins
ClosedPublic

Authored by bondhugula on Mar 27 2020, 11:14 PM.

Details

Summary

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@polymagelabs.com>

Diff Detail

Event Timeline

bondhugula created this revision.Mar 27 2020, 11:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2020, 11:14 PM

clang-format missed changes

Fix inadvertent format changes

Harbormaster failed remote builds in B50774: Diff 253297!
Harbormaster failed remote builds in B50772: Diff 253295!
xbolva00 accepted this revision.Mar 29 2020, 9:40 AM
This revision is now accepted and ready to land.Mar 29 2020, 9:40 AM
This revision was automatically updated to reflect the committed changes.