When the inliner merges allocas, it must keep the larger alignment
authorHal Finkel <hfinkel@anl.gov>
Tue, 16 Jul 2013 17:10:55 +0000 (17:10 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 16 Jul 2013 17:10:55 +0000 (17:10 +0000)
commit5a5ebb7f9fa7fa82c0c466a36a90e5c18bb13073
treea78ba9387b19f55633afbc1fee33bae754514e0a
parent95779b65cf7b7d7c22bf2d22d03c661c8130cbe2
When the inliner merges allocas, it must keep the larger alignment

For safety, the inliner cannot decrease the allignment on an alloca when
merging it with another.

I've included two variants of the test case for this: one with DataLayout
available, and one without. When DataLayout is not available, if only one of
the allocas uses the default alignment (getAlignment() == 0), then they cannot
be safely merged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186425 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/Inliner.cpp
test/Transforms/Inline/alloca-merge-align-nodl.ll [new file with mode: 0644]
test/Transforms/Inline/alloca-merge-align.ll [new file with mode: 0644]