[Codegen] Emit both AssumeAlignedAttr and AllocAlignAttr assumptions if they exist
authorRoman Lebedev <lebedev.ri@gmail.com>
Tue, 21 Jan 2020 18:18:27 +0000 (21:18 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Tue, 21 Jan 2020 18:18:27 +0000 (21:18 +0300)
commit372cb38f4510212f4bd21488b71620775d8d4fc2
treefdb7fb93844499e0d7993369dfc5560af7e0f6ef
parentcf263807a6c0a6989476ae9d44a21a657e048c94
[Codegen] Emit both AssumeAlignedAttr and AllocAlignAttr assumptions if they exist

Summary:
We shouldn't be just giving up if we find one of them
(like we currently do with `AssumeAlignedAttr`),
we should emit them all.

As the tests show, even if we materialized good knowledge
from `__attribute__((assume_aligned(32)`, it doesn't mean
`__attribute__((alloc_align([...])))` info won't be useful.
It might be, but that isn't given.

Reviewers: erichkeane, jdoerfert, aaron.ballman

Reviewed By: erichkeane

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D72979
clang/lib/CodeGen/CGCall.cpp
clang/test/CodeGen/assume-aligned-and-alloc-align-attributes.c [new file with mode: 0644]