[Clang] Propagate guaranteed alignment for malloc and others
authorDávid Bolvanský <david.bolvansky@gmail.com>
Fri, 23 Apr 2021 08:11:59 +0000 (10:11 +0200)
committerDávid Bolvanský <david.bolvansky@gmail.com>
Fri, 23 Apr 2021 09:07:14 +0000 (11:07 +0200)
commitc2297544c04764237cedc523083c7be2fb3833d4
treeaeed25cff18aee55c82c822db906552732d14863
parenta819e7339315687f06f686971a649f614afbd987
[Clang] Propagate guaranteed alignment for malloc and others

LLVM should be smarter about *known* malloc's alignment and this knowledge may enable other optimizations.

Originally started as LLVM patch - https://reviews.llvm.org/D100862 but this logic should be really in Clang.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D100879
clang/include/clang/Basic/TargetInfo.h
clang/lib/CodeGen/CGCall.cpp
clang/test/CodeGen/alloc-fns-alignment.c [new file with mode: 0644]