<span class="Apple-style-span" style="font-family:Helvetica;font-size:medium">Hi Elena,</span><div style="font-family:Helvetica;font-size:medium"><br></div><div style="font-family:Helvetica;font-size:medium">You're correct. LLVM does not align the stack to 32-bytes for AVX and unaligned moves should be used for YMM spills.</div>
<div style="font-family:Helvetica;font-size:medium"><br></div><div style="font-family:Helvetica;font-size:medium">I wrote some code to align the stack to 32-bytes when AVX spills are present; it does break the x86-64 ABI though. If upstream would be interested in this code, I can arrange with my employer to send a patch to the mailing list.</div>
<div style="font-family:Helvetica;font-size:medium"><br></div><div style="font-family:Helvetica;font-size:medium">-Cameron</div><div style="font-family:Helvetica;font-size:medium"><br><div class="AppleOriginalContents"><div>
On Mar 1, 2012, at 4:09 PM, <<a href="mailto:llvmdev-request@cs.uiuc.edu">llvmdev-request@cs.uiuc.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">Message: 2<br>
Date: Thu, 1 Mar 2012 18:16:46 +0000<br>From: "Demikhovsky, Elena" <<a href="mailto:elena.demikhovsky@intel.com">elena.demikhovsky@intel.com</a>><br>Subject: [LLVMdev] Stack alignment on X86 AVX seems incorrect<br>
To: "<a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>" <<a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>><br>Message-ID:<br><span class="Apple-tab-span" style="white-space:pre">     </span><<a href="mailto:A0DC88CEB3010344830D52D66533DA8E0C2E7A@HASMSX103.ger.corp.intel.com">A0DC88CEB3010344830D52D66533DA8E0C2E7A@HASMSX103.ger.corp.intel.com</a>><br>
Content-Type: text/plain; charset="windows-1252"<br><br>./llc -mattr=+avx -stack-alignment=16 < basic.ll | grep movaps | grep ymm | grep rbp<br>       vmovaps -176(%rbp), %ymm14<br>       vmovaps -144(%rbp), %ymm11<br>
       vmovaps -240(%rbp), %ymm13<br>       vmovaps -208(%rbp), %ymm9<br>       vmovaps -272(%rbp), %ymm7<br>       vmovaps -304(%rbp), %ymm0<br>       vmovaps -112(%rbp), %ymm0<br>       vmovaps -80(%rbp), %ymm1<br>       vmovaps -112(%rbp), %ymm0<br>
       vmovaps -80(%rbp), %ymm0<br>       vmovaps -176(%rbp), %ymm15<br>       vmovaps -144(%rbp), %ymm0<br>       vmovaps -240(%rbp), %ymm0<br>       vmovaps -208(%rbp), %ymm0<br>       vmovaps -272(%rbp), %ymm0<br>       vmovaps -304(%rbp), %ymm0<br>
<br>vmovaps should not access stack if it is not aligned to 32<br><br>- Elena</span></blockquote><div><span class="Apple-style-span" style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><br>
</span></div></div></div>