[llvm-commits] [PATCH] Support the 'alignstack' attribute in the x86 backend

Charles Davis cdavis at mymail.mines.edu
Wed Feb 17 11:55:29 PST 2010


Anton Korobeynikov wrote:
> Hello, Charles
> 
>> This patch in the force_align_arg_pointer series adds support for the
>> alignstack() attribute to the x86 backend. It's a very simple patch, but
>> I feel like it's missing something.
> Yes, a bit. Two questions:
> 1. What if current stack alignment is more than specified by
> attribute. In such case no realignment will be needed. However, I feel
> that in such case your patch will force realignment as well. Try to
> increase the stack alignment and / or just try the stuff with darwin.
Uhhh... I run Darwin.

Also, I think that's the behavior we want.

In Wine, they use the force_align_arg_pointer attribute because their
functions are called from code that only keeps the stack aligned to 4
bytes. But since the default alignment on Darwin is 16 bytes, if we do
it the way you suggest, the force realignment won't take place, making
this useless and we'll be right back where we started.

The point of this is to FORCE the stack to be aligned to a certain
value, even if the ABI says the stack is aligned to some other value.
> 2. Are you sure that the maximum alignment you set won't be clobberred
> in the case when e.g. there will be vector spills?
I am now. Patch reattached with stronger test case.

Chip

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: faap-support-4.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100217/24290d85/attachment.ksh>


More information about the llvm-commits mailing list