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

Duncan Sands baldrick at free.fr
Sun Oct 9 02:32:13 PDT 2011


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.



More information about the llvm-commits mailing list