<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 7, 2012, at 4:33 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="font-family: Optima; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; ">However, it does seem like this should be no more than an 'and' instruction in the worst case (we don't have known alignment of the stack).</span></blockquote></div><br><div>Realigning the stack requires the function to have a frame pointer, so frame pointer elimination is no longer possible. If you  have dynamically sized allocas, a reserved base pointer register is also necessary.</div><div><br></div><div>Reserving 2 out of 7 registers on x86 can have quite the performance impact.</div><div><br></div><div>Base pointer support is quite new, BTW. Previously, we simply refused to compile functions that required stack realignment and dynamic allocas.</div><div><br></div><div>/jakob</div><div><br></div></body></html>