<div dir="ltr"><div>Hello Sean,<br>I can't really comment on the implementation details
( optimization remarks vs object section); But we would certainly be
interested in a generic way to extract stack size information.<br></div><div><br>On
the subject of stack size, have you done any gcc vs llvm comparison ?
Last time we look at it, LLVM seems to generate larger stack size than
gcc (especially at higher inline thresholds) . I am curious if other
people have noticed the same thing. <br></div><br>Compiler Engineering @ Facebook,inc.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 31, 2017 at 7:09 AM, Sean Eveson via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><p class="MsoNormal"><font face="arial, helvetica, sans-serif"><span style="color:black">Hi All,</span><span style="color:rgb(33,33,33)"><span></span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif"><span style="color:black"> </span><span style="color:rgb(33,33,33)"><span></span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif"><span style="color:black">We have a local change in the
X86AsmPrinter that outputs a section containing metadata on function stack
sizes. We use this to measure changes to stack size between versions of the
compiler and it also allows our licensees to do the same for their code.</span><span style="color:rgb(33,33,33)"><span></span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif"><span style="color:black"> </span><span style="color:rgb(33,33,33)"><span></span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif"><span style="color:black">The section simply contains pairs
of function symbol references (8 byte) and stack sizes (unsigned LEB128).</span><span style="color:rgb(33,33,33)"><span></span></span></font></p>
<p class="MsoNormal"><span style="color:rgb(33,33,33)"><font face="arial, helvetica, sans-serif"> <span></span></font></span></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif"><span style="color:black">We would like to upstream this
change as a PS4 only modification, or as a more general cross platform one.</span><span style="color:rgb(33,33,33)"><span></span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif"><span style="color:black"> </span><span style="color:rgb(33,33,33)"><span></span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif"><span style="color:black">Would people be interested in (or
happy with) such a patch, target specific or otherwise?</span><span style="color:rgb(33,33,33)"><span></span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif"><span style="color:black"> </span><span style="color:rgb(33,33,33)"><span></span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif"><span style="color:black">Thanks,</span><span style="color:rgb(33,33,33)"><span></span></span></font></p></div><font face="arial, helvetica, sans-serif"><br clear="all"></font><div><div class="m_6919753945198399727gmail_signature"><div dir="ltr"><div class="m_6919753945198399727gmail_signature"><div dir="ltr"><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0);line-height:18.85px">Sean Eveson</span><br style="color:rgb(0,0,0);line-height:18.85px"><span style="color:rgb(0,0,0);line-height:18.85px">SN Systems - Sony Interactive Entertainment</span></font><br></div></div></div></div></div>
</div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>