Try to use a better set of abstractions for computing the alignment
authorChandler Carruth <chandlerc@gmail.com>
Wed, 3 Oct 2012 08:14:02 +0000 (08:14 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 3 Oct 2012 08:14:02 +0000 (08:14 +0000)
commit4b2b38d3982c115906ecc81fa9be3cf5d0330a3d
treee5c8097870208a40a05b0fca71ef0c56495775c9
parentf4fba5cf7a0d01414b462eac4a3741e9a3f2ef0f
Try to use a better set of abstractions for computing the alignment
necessary during rewriting. As part of this, fix a real think-o here
where we might have left off an alignment specification when the address
is in fact underaligned. I haven't come up with any way to trigger this,
as there is always some other factor that reduces the alignment, but it
certainly might have been an observable bug in some way I can't think
of. This also slightly changes the strategy for placing explicit
alignments on loads and stores to only do so when the alignment does not
match that required by the ABI. This causes a few redundant alignments
to go away from test cases.

I've also added a couple of tests that really push on the alignment that
we end up with on loads and stores. More to come here as I try to fix an
underlying bug I have conjectured and produced test cases for, although
it's not clear if this bug is the one currently hitting dragonegg's
gcc47 bootstrap.

llvm-svn: 165100
llvm/lib/Transforms/Scalar/SROA.cpp
llvm/test/Transforms/SROA/alignment.ll