[PATCH] Don't Promote x86_fp80 byval Pointer Arguments

Thomas Jablin tjablin at gmail.com
Tue Aug 26 10:22:10 PDT 2014


Hi Reid,

I have updated the test case to include your { i32, i64 } example from yesterday. The structure is still correctly promoted. I switched from the DL->getAllocSize approach to testing for the x86_fp80 type explicitly, since DL is not guaranteed to be available in the ArgumentPromotion pass.

Looking at the implementation of DataLayout, I can see that the alloc size only differs from the store size when the store size mod the ABI alignment is not zero. Other than x86_fp80, there's no way this can happen for C or C++ codes (where the size of an aggregate is guaranteed to be a multiple of its alignment).

Tom

http://reviews.llvm.org/D5057

Files:
  lib/Transforms/IPO/ArgumentPromotion.cpp
  test/Transforms/ArgumentPromotion/fp80.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5057.12953.patch
Type: text/x-patch
Size: 2704 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140826/c5366297/attachment.bin>


More information about the llvm-commits mailing list