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

Renato Golin renato.golin at linaro.org
Wed Feb 26 11:25:57 PST 2014


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