[llvm-commits] [ARM] Extra frame for non-VA byval parameter

Stepan Dyatkovskiy stpworld at narod.ru
Thu Oct 4 10:45:43 PDT 2012


Hi all.
Perhaps it is not a mistake. But.. ARMISelLowering may produce two fixed 
stack objects for byval argument. It happens in case if we have free 
core registers and it is possible to allocate them as byval registers.

Please, look at ARMTargetLowering::LowerFormalArguments, code fragment 
started from string "if (Flags.isByVal())".
This branch allocates frame for byval registers ("regs-frame") and then 
it allocates frame for remained part of byval parameter 
("remainder-frame"). "refs-frame" is created within 
VarArgStyleRegisters, the "remainder-frame" created explicitly on the 
top level of branch.
Ideally, "regs-frame" should be connected to the "remainder-frame" 
afterall. That allows to use it as solid part then. But no dependencies 
added between regs-frame and remainder-frame. So scheduler may insert 
first byval argument usage before the baval regs will saved into stack area.

Please find fix in attachment.
Thanks!

-Stepan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: byval-frame-fix.patch
Type: text/x-patch
Size: 1482 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121004/ab3c33f5/attachment.bin>


More information about the llvm-commits mailing list