ARM: Correctly align arguments after a byval struct is passed on the stack

Oliver Stannard oliver.stannard at arm.com
Thu Feb 27 01:12:20 PST 2014


I ran some random PCS tests on this patch overnight, and it seems to have
introduced a regression. I'll send out a fixed patch once I have one.

Oliver

-----Original Message-----
From: Renato Golin [mailto:renato.golin at linaro.org] 
Sent: 26 February 2014 19:26
To: Oliver Stannard
Cc: LLVM Commits
Subject: Re: ARM: Correctly align arguments after a byval struct is passed
on the stack

On 24 February 2014 12:50, Oliver Stannard <oliver.stannard at arm.com> wrote:
> The solution to this is to not allocate stack space for the part of a
byval
> which will be passed in registers. This requires some extra work to
> calculate the location of byval arguments on the stack, especially in the
> case of multiple small byvals in registers, as previously the stack
> locations were used to record the location of a byval after storing to the
> stack.

Hi Oliver,

If I got it right, you're replacing the pre-calculation of the stack
position for an in-line calculation during the placement of the
arguments. If that's so, this looks like a cleaner solution indeed.

I only worry about the test. It's very specific and if checks for a
long sequence of instructions in the right order. Though most of it is
prologue and should be fixed anyway. I'd at least force a CPU, to make
sure it won't fail if we change the default CPU one day.

Also, did you run the test-suite? Random PCS tests? Would be good to
know if at least some basic validation was done to it in general. This
is the kind of change that can break more complex code is subtle
ways...

cheers,
--renato







More information about the llvm-commits mailing list