[llvm-dev] Aligned vector spills and variably sized stack frames
Reid Kleckner via llvm-dev
llvm-dev at lists.llvm.org
Mon Aug 31 09:36:22 PDT 2015
On Sun, Aug 30, 2015 at 6:09 PM, Joseph Tremoulet via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> > If someone has another approach, I'm also very open to that.
> I recently saw another compiler use a "cute trick" for this sort of thing:
> allocate a fixed amount of space on the stack by including the worst-case
> padding, and then dynamically set the frame pointer to an aligned location
> within that. I wouldn't go so far as to say that's a *better* approach (it
> seems gimmicky/fishy and could open other problems by surprising your
> runtime/tools in other ways), but it's certainly *another* one :). The
> only actual benefit that comes to mind is that it would cover other sources
> of dynamic alignment than RA spill slots, if that's something you need to
> worry about.
I came here to suggest this approach also. :)
Right now the X86 backend is using a stack realignment prologue that is
designed to fixup the incoming and outgoing alignment to some number. We
only need this prologue when the user is telling us that the incoming
alignment is too low, and it must be fixed up (i.e. -mstackrealign).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev