Don't promote byval pointer arguments when padding matters
authorReid Kleckner <reid@kleckner.net>
Thu, 28 Aug 2014 22:42:00 +0000 (22:42 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 28 Aug 2014 22:42:00 +0000 (22:42 +0000)
commit8f58e0264604a50d443c4431c5edb50ed64ff5ee
tree3f7d4aa7cd0adf9ca8d9f1cf42bcf08ec048bd0f
parent0d34b1ed269e8609803ec5c3b3ea8ebc8e03d898
Don't promote byval pointer arguments when padding matters

Don't promote byval pointer arguments when when their size in bits is
not equal to their alloc size in bits. This can happen for x86_fp80,
where the size in bits is 80 but the alloca size in bits in 128.
Promoting these types can break passing unions of x86_fp80s and other
types.

Patch by Thomas Jablin!

Reviewed By: rnk

Differential Revision: http://reviews.llvm.org/D5057

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216693 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/ArgumentPromotion.cpp
test/Transforms/ArgumentPromotion/fp80.ll [new file with mode: 0644]
test/Transforms/ArgumentPromotion/tail.ll