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

Lang Hames lhames at apple.com
Sat Oct 8 11:13:35 PDT 2011


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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: NaturalStackAlignment.patch
Type: application/octet-stream
Size: 9957 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111008/726373cc/attachment.obj>


More information about the llvm-commits mailing list