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

Manman Ren mren at apple.com
Mon Oct 8 19:06:31 PDT 2012


Hi Stepan,

The stack object created in VarArgStyleRegisters is for the first part of the struct,
the stack object created in LowerFormalArguments is for the remainder part and these two parts do not overlap.
So I do not think we need dependencies between these two frames.

Can you attach a testing case with this patch so I can take a deeper look at this?

Thanks,
Manman

On Oct 8, 2012, at 8:15 AM, Stepan Dyatkovskiy <stpworld at narod.ru> wrote:

> ping.
> Stepan Dyatkovskiy wrote:
>> 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.
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list