[llvm-commits] [PATCH] Add support for functions with VLAs and dynamic stack realignment on x86

Chad Rosier mcrosier at apple.com
Wed May 30 14:53:12 PDT 2012


This attached patch adds support for functions that include VLAs and require dynamic stack realignment on x86.  

The ABI specifies a default alignment of 16-bytes, which has been enough in general.  However, AVX code commonly requires 32-byte alignment, so as we move forward with AVX support this fix will become more critical.  We currently generate miscompiled code in these rare cases (without warning).  The attached solution is the same as that used for the ARM backend.  Specifically, an additional Base Register is reserved when VLAs are present and dynamic stack realignment is required.  The final test case, t6, has a FIXME that I plan to implement after this patch has been applied; basically, the RA has already reserved the register designated for use as the Base Pointer, so we fail.  Functions that do not include VLAs _and_ require dynamic stack realignment should not be effected.

 Chad

-------------- next part --------------
A non-text attachment was scrubbed...
Name: x86-VLAs-dynamic-realignment.patch
Type: application/octet-stream
Size: 13878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120530/44e3addb/attachment.obj>


More information about the llvm-commits mailing list