<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 11, 2015 at 3:51 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Fri, Sep 11, 2015 at 3:30 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br></span><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>----- Original Message -----<br>
> From: "Reid Kleckner via llvm-commits" <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>><br>
> To: "Akira Hatanaka" <<a href="mailto:ahatanak@gmail.com" target="_blank">ahatanak@gmail.com</a>><br>
> Cc: "llvm-commits" <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>><br>
> Sent: Friday, September 11, 2015 5:08:38 PM<br>
> Subject: Re: [llvm] r247450 - Use function attribute "stackrealign" to decide whether stack<br>
><br>
><br>
><br>
> I recall some users from nvidia or Intel did something like arranging<br>
> to call a function using AVX with 32-byte stack alignment, and using<br>
> -mno-stackrealign to suppress the funky prologue. They would<br>
> probably be better served with an ABI stack alignment override, so<br>
> maybe that use case is not worth considering.<br>
><br>
<br>
</span>It seems like, for this use case, we really want an attribute to specify what the enhanced caller-provided stack alignment actually is, so that the backend can then make the appropriate choice about generating a stack realignment based on the needs of its local variables and spill slots.<br></blockquote><div><br></div></span><div>Precisely. Actually, don't we already have an attribute for this? Isn't "stackrealign" equivalent to alignstack(1)?</div></div></div></div>
</blockquote></div><br></div><div class="gmail_extra">I believe we can substitute "stackrealign" with alignstack=1. The only place that needs to be changed to make them equivalent is X86FrameLowering::calculateMaxStackAlign. We have to check whether the function has Attribute::StackAlignment rather than "stackrealign".</div><div class="gmail_extra"><br></div><div class="gmail_extra">That will make the backend slightly simpler. The potential downside is that it might not be immediately clear that alignstack=1 means "force stack realignment".</div></div>