ARM, PR15868 Release-blocker fix. ByVal parameters padding fix.
Stepan Dyatkovskiy
stpworld at narod.ru
Mon May 13 06:26:55 PDT 2013
Hi all,
In case when stack alignment is 8 and GPRs parameter part size is not
N*8: we add padding to GPRs part, so part's last byte must be recovered
at address K*8-1.
We need to do it, since remained (stack) part of parameter starts from
address K*8, and we need to "attach" "GPRs head" without gaps to it:
Stack:
|---- 8 bytes block ----| |---- 8 bytes block ----| |---- 8 bytes...
[ [padding] [GPRs head] ] [ ------ Tail passed via stack ------ ...
Note, once we added padding we need to correct *all* Arg offsets that
are going after padded one.
That's why we need this fix: Arg offsets were never corrected before
this patch. See new test-case included in patch.
We also don't need to insert padding for byval parameters that are
stored in GPRs only. We need pad only last byval parameter and only in
case it outsides GPRs and stack alignment = 8.
Please find the patch in attachment.
This patch reduces stack usage for some cases:
We can reduce ArgRegsSaveArea since inner 4 bytes sized byval params my
be "packed" with alignment 4.
This patch also fixes PR15868 release-blocking issue.
-Stepan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr15868-2013-05-13-2.patch
Type: text/x-diff
Size: 7757 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130513/3622c903/attachment.patch>
More information about the llvm-commits
mailing list