diff options
author | Hal Finkel <hfinkel@anl.gov> | 2014-07-22 16:58:55 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2014-07-22 16:58:55 +0000 |
commit | ccc7090671cda0f1a6578988659b877b57d91ce5 (patch) | |
tree | a2d34de66ed34d232d0999700b5d3eb99407cb90 /llvm/test/Bitcode | |
parent | 9ef307bfc1b6a130c616b030758699bdadbe4008 (diff) | |
download | bcm5719-llvm-ccc7090671cda0f1a6578988659b877b57d91ce5.tar.gz bcm5719-llvm-ccc7090671cda0f1a6578988659b877b57d91ce5.zip |
Make use of the align parameter attribute for all pointer arguments
We previously supported the align attribute on all (pointer) parameters, but we
only used it for byval parameters. However, it is completely consistent at the
IR level to treat 'align n' on all pointer parameters as an alignment
assumption on the pointer, and now we wll. Specifically, this causes
computeKnownBits to use the align attribute on all pointer parameters, not just
byval parameters. I've also added an explicit parameter attribute test for this
to test/Bitcode/attributes.ll.
And I've updated the LangRef to document the align parameter attribute (as it
turns out, it was not documented at all previously, although the byval
documentation mentioned that it could be used).
There are (at least) two benefits to doing this:
- It allows enhancing alignment based on the pointer alignment after inlining callees.
- It allows simplification of pointer arithmetic.
llvm-svn: 213670
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r-- | llvm/test/Bitcode/attributes.ll | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/attributes.ll b/llvm/test/Bitcode/attributes.ll index 2490e592072..9a429f6e21f 100644 --- a/llvm/test/Bitcode/attributes.ll +++ b/llvm/test/Bitcode/attributes.ll @@ -239,6 +239,11 @@ define dereferenceable(18446744073709551606) i8* @f40(i8* dereferenceable(184467 ret i8* %a } +define void @f41(i8* align 32, double* align 64) { +; CHECK: define void @f41(i8* align 32, double* align 64) { + ret void +} + ; CHECK: attributes #0 = { noreturn } ; CHECK: attributes #1 = { nounwind } ; CHECK: attributes #2 = { readnone } |