[llvm-commits] Natural Stack Alignment - Prevent overly aggressive alignment promotion.

Chad Rosier mcrosier at apple.com
Sun Oct 9 18:15:46 PDT 2011


Cameron,
You're correct.  This is definitely happening for some code compile in thumb1 mode.  See: <rdar://problem/10043857>.

 Chad

On Oct 9, 2011, at 4:01 PM, Cameron Zwarich wrote:

> Are you going to change the affected backends to do the right thing and emit an error if unsupported dynamic stack realignment is required? IIRC, currently incorrect code is silently generated.
> 
> Cameron
> 
> On Oct 8, 2011, at 11:13 AM, Lang Hames <lhames at apple.com> wrote:
> 
>> Hi All,
>> 
>> I'm looking for feedback on the following patch, which adds a natural stack alignment field to target data. The intent is to prevent instcombine and other passes from promoting alloca alignment past the natural alignment, which would force a dynamic stack realignment (this un-breaks some cases where such alignment promotions forced dynamic stack realignment on platforms that don't support it). This patch sets the default alignment to 32 bits, which can be overridden by a new "S<size>" option in target data strings (size in bits, must be a multiple of 8).
>> 
>> Does anyone have any thoughts on this scheme? Questions and comments are very welcome. Assuming it's adopted, any Target maintainers whose platforms have a higher natural alignment should explicitly add the "S<size>" field to their target data strings so that they don't miss out on alignment promotion opportunities.
>> 
>> Cheers,
>> Lang.
>> 
>> 
>> <NaturalStackAlignment.patch>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> _______________________________________________
> 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