[llvm-commits] [patch] Fix va_arg for double and some cleanups

Rafael Espindola espindola at google.com
Tue Jul 6 14:41:03 PDT 2010


The attached patch fixes va_arg for double on ARM. Since f64 is valid,
the VAARG node is never split. The best fix is probably to always set
the alignment. This also simplifies DAGTypeLegalizer::ExpandRes_VAARG
since it now doesn't need to compute the max.

One issues is that we would produce silly code like

         add     r0, r0, #3
         bfc     r0, #0, #2

for the vaarg of i32. What is the correct way to find the minimum
alignment of an argument? This is not the same as the stack alignment
at function entry. For example, for ARM the correct value is 4, since
values smaller than 32 bits are promoted (see 5.2.1.1 and 5.2.1.2 in
AAPCS).

Cheers,
-- 
Rafael Ávila de Espíndola
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vaarg.patch
Type: text/x-diff
Size: 5773 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100706/68ac8854/attachment.patch>


More information about the llvm-commits mailing list