[PATCH] Correctly align arguments after a byval struct is passed on the stack

Oliver Stannard oliver.stannard at arm.com
Tue Mar 4 03:51:42 PST 2014

  Added some (phabricator) comments to explain test changes.

Comment at: test/CodeGen/ARM/2013-04-05-Small-ByVal-Structs-PR15293.ll:7
@@ -6,3 +6,3 @@
 ;CHECK: 	push	{r11, lr}
-;CHECK: 	str	r0, [sp, #8]
-;CHECK: 	add	r0, sp, #8
+;CHECK: 	str	r0, [sp, #12]
+;CHECK: 	add	r0, sp, #12
This change uses the top half of the 8-byte byval-save memory region, rather than the bottom. Both are equally valid in this case.

Comment at: test/CodeGen/ARM/2013-05-02-AAPCS-ByVal-Structs-C4-C5-VFP.ll:26
@@ -25,4 +25,3 @@
   ;CHECK: push.w {r11, lr}
-  ;CHECK: add r0, sp, #16
-  ;CHECK: str r2, [sp, #20]
-  ;CHECK: str r1, [sp, #16]
+  ;CHECK: add r0, sp, #8
+  ;CHECK: str r2, [sp, #12]
This test was actually testing for incorrect behaviour. Previously, the byval arguments were being stored 8 bytes too high in memory, outside of the byval-save region. This patch corrects this.


More information about the llvm-commits mailing list