OSDN Git Service

[Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's Alignment...
authorRoman Lebedev <lebedev.ri@gmail.com>
Thu, 23 Jan 2020 19:50:24 +0000 (22:50 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Thu, 23 Jan 2020 19:50:49 +0000 (22:50 +0300)
commit5ffe6408ffb6ad8642598ab03de04d58b4980e81
tree1777925d0674e401023614ec72553e92dadbbd83
parente819f7c9feb4d4b611681e319fbb43fd28b3f5b7
[Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's Alignment Attribute on call-site function return value

Summary:
Much like with the previous patch (D73005) with `AssumeAlignedAttr`
handling, results in mildly more readable IR,
and will improve test coverage in upcoming patch.

Note that in `AllocAlignAttr`'s case, there is no requirement
for that alignment parameter to end up being an I-C-E.

Reviewers: erichkeane, jdoerfert, hfinkel, aaron.ballman, rsmith

Reviewed By: erichkeane

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73006
clang/lib/CodeGen/CGCall.cpp
clang/test/CodeGen/assume-aligned-and-alloc-align-attributes.c
clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function.cpp