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)
commitf710fb14ee951fe533b94eb1046d422e94d4f1f3
treebe17660b119386bc889a3a1ecdf0f0fca8f7a16e
parent76ad43c6e1619ed4c087b8ccb2cd573eb9d7093e
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165100 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SROA.cpp
test/Transforms/SROA/alignment.ll