[ArgPromotion] Preserve alignment of byval argument in new alloca
authorReid Kleckner <rnk@google.com>
Fri, 4 Aug 2017 17:09:11 +0000 (17:09 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 4 Aug 2017 17:09:11 +0000 (17:09 +0000)
commitda748f1c3d92f7bd02ee3292f3d9654d4f0f4a45
tree01579f445c01742b3c12d7cbe75ac2f1c5b98c36
parentf785fd94c65c1268556ed89e2485a3673e343ae8
[ArgPromotion] Preserve alignment of byval argument in new alloca

The frontend may have requested a higher alignment for any reason, and
downstream optimizations may already have taken advantage of it.  We
should keep the same alignment when moving the allocation from the
parameter area to the local variable area.

Fixes PR34038

llvm-svn: 310071
llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
llvm/test/Transforms/ArgumentPromotion/byval.ll