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

Lang Hames lhames at apple.com
Sun Oct 9 10:56:06 PDT 2011


Hi Duncan,

I don't think so. In the ARM bug I'm looking at i64's have a 64-bit preferred alignment, but the natural stack alignment is only 32-bits. I don't see anything inherently wrong with that, but it would force a dynamic stack realignment. This patch is designed to avoid such situations.

Cheers,
Lang.


On Oct 9, 2011, at 2:32 AM, Duncan Sands wrote:

> Hi Lang,
> 
>> 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.
> 
> presumably instcombine only promotes alignment to the target's preferred
> alignment.  If a target has set the preferred alignment to more than the
> stack alignment, isn't that a bug in the target?
> 
> Ciao, Duncan.
> _______________________________________________
> 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