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)
commit9caa8f7ba7b74bce41dc37b4e9ac61096c65683e
tree413b23e1c53e9404373af0ccf4ef4740235ac408
parentd4060fd281388cf7bcb917472f20fc4b858471e9
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.

llvm-svn: 186425
llvm/lib/Transforms/IPO/Inliner.cpp
llvm/test/Transforms/Inline/alloca-merge-align-nodl.ll [new file with mode: 0644]
llvm/test/Transforms/Inline/alloca-merge-align.ll [new file with mode: 0644]