<div>That's not what I was expecting.</div><div><br></div><div>If that is what is expected, then it seems that <2 x i64> should have 16-byte stack alignment.</div><div><br></div><div>This might be a bug with <span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">getCallFrameTypeAlignment(), or perhaps the DataLayout?</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">- David M</span></div>
<meta charset="utf-8"><br><br><div class="gmail_quote">On Thu, Oct 14, 2010 at 7:53 AM, Rafael Espindola <span dir="ltr"><<a href="mailto:espindola@google.com">espindola@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 13 October 2010 22:21, David Meyer <<a href="mailto:pdox@google.com">pdox@google.com</a>> wrote:<br>
> Rafael,<br>
</div><div class="im">> I'm afraid not. <2 x i64> is aligned to 8-bytes on X86-64, both ABI and<br>
> stack.<br>
> I'm not sure there's any way to "test" this change... it may have no<br>
> external effects (except for Native Client). All major architectures have<br>
> stack alignment the same as ABI alignment. In principle, however, I think<br>
> this change is correct.<br>
<br>
</div>I tested<br>
<br>
define <2 x i64> @test(i32 %a, i32 %b, ...) nounwind optsize {<br>
entry:<br>
%ap = alloca i8*, align 4 ; <i8**> [#uses=3]<br>
%ap1 = bitcast i8** %ap to i8* ; <i8*> [#uses=2]<br>
call void @llvm.va_start(i8* %ap1)<br>
%0 = va_arg i8** %ap, i32 ; <i32> [#uses=0]<br>
%1 = va_arg i8** %ap, <2 x i64> ; <double> [#uses=1]<br>
call void @llvm.va_end(i8* %ap1)<br>
ret <2 x i64> %1<br>
}<br>
declare void @llvm.va_start(i8*) nounwind<br>
declare void @llvm.va_end(i8*) nounwind<br>
<br>
With and without your patch. Without your patch there is an extra<br>
<br>
addq $15, %rcx<br>
andq $-16, %rcx<br>
<br>
in the output. So it is really reducing the alignment requirement of<br>
<2 x i64>. I think but I am not sure that this is a fix and not a<br>
regression :-)<br>
<br>
So, is this what you were expecting?<br>
<div><div></div><div class="h5"><br>
> - David M<br>
<br>
Cheers,<br>
--<br>
Rafael Ávila de Espíndola<br>
</div></div></blockquote></div><br>