diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2020-01-23 22:50:15 +0300 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2020-01-23 22:50:49 +0300 |
commit | e819f7c9feb4d4b611681e319fbb43fd28b3f5b7 (patch) | |
tree | 0f8a318cfae1b1fb142a946863ce1e2bb904c572 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | d096f8d306b2b16a25f65ffb70849ca7963a0dac (diff) | |
download | llvm-e819f7c9feb4d4b611681e319fbb43fd28b3f5b7.zip llvm-e819f7c9feb4d4b611681e319fbb43fd28b3f5b7.tar.gz llvm-e819f7c9feb4d4b611681e319fbb43fd28b3f5b7.tar.bz2 |
[Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment Attribute on call-site function return value
Summary:
This should be mostly NFC - we still lower the same alignment
knowledge to the IR. The main reasoning here is that
this somewhat improves readability of IR like this,
and will improve test coverage in upcoming patch.
Even though the alignment is guaranteed to always be an I-C-E,
we don't always materialize it as llvm's Alignment Attribute because:
1. There may be a non-zero offset
2. We may be sanitizing for alignment
Note that if there already was an IR alignment attribute
on return value, we union them, and thus the alignment
only ever rises.
Also, there is a second relevant clang attribute `AllocAlignAttr`,
so that is why `AbstractAssumeAlignedAttrEmitter` is templated.
Reviewers: erichkeane, jdoerfert, hfinkel, aaron.ballman, rsmith
Reviewed By: erichkeane
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73005
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions