Merging r260587:
authorHans Wennborg <hans@hanshq.net>
Fri, 12 Feb 2016 01:42:38 +0000 (01:42 +0000)
committerHans Wennborg <hans@hanshq.net>
Fri, 12 Feb 2016 01:42:38 +0000 (01:42 +0000)
commit7a0ec464f16e761602ac9c4e1f610029c0346745
treee63b41e3989fd86ab70e8c081f5c8eccecd79d37
parent73a8ae3c0f127d45e391bd8b40be51c2fbc15dd8
Merging r260587:
------------------------------------------------------------------------
r260587 | pete | 2016-02-11 13:10:40 -0800 (Thu, 11 Feb 2016) | 13 lines

Set load alignment on aggregate loads.

When optimizing a extractvalue(load), we generate a load from the
aggregate type.  This load didn't have alignment set and so would
get the alignment of the type.  This breaks when the type is packed
and so the alignment should be lower.

For example, loading { int, int } would give us alignment of 4, but
the original load from this type may have an alignment of 1 if packed.

Reviewed by David Majnemer

Differential revision: http://reviews.llvm.org/D17158
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@260640 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
test/Transforms/InstCombine/unpack-fca.ll