<div dir="ltr">Go for it. :)</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 7, 2014 at 10:03 AM, Arnaud A. de Grandmaison <span dir="ltr"><<a href="mailto:arnaud.degrandmaison@arm.com" target="_blank">arnaud.degrandmaison@arm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal">[Sorry for the cross-posting, but this future change in clang can affect llvm optimization passes]<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Language frontends can insert lifetime.start / lifetime.end markers for objects allocated on the stack, providing the optimization passes in LLVM with lifetime information so that they can share stack slots and reduce stack usage of the generated code. Today, those lifetime markers are only inserted for objects > 32 bytes. This threshold was set to prevent  impacting compile time. Lifetime markers have been in use for a long time now, and some passes got fixed to deal gracefully with them.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I intend to commit soon a patch removing this threshold, unless someone objects or raise concerns. Removing the threshold can only improve stack size usage of the generated code, but there is a risk that some specific code base trigger some corner case bugs, thus this heads-up.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I checked that compile time was not impacted by building llvm+clang+lldb with a clang with various thresholds, and here are the results (user time in seconds for a build from scratch, averaged over 5 builds). Note that the reported  threshold is inclusive: 33 (the current threshold) means all object whose size >= 33 bytes will be marked for example.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><table border="0" cellspacing="0" cellpadding="0" width="197" style="width:148.0pt;border-collapse:collapse"><tbody><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">Threshold<u></u><u></u></p></td><td width="63" nowrap valign="bottom" style="width:47.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">Average<u></u><u></u></p></td><td width="71" nowrap valign="bottom" style="width:53.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">Variance<u></u><u></u></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">33<u></u><u></u></p></td><td width="63" nowrap valign="bottom" style="width:47.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">4652.67<u></u><u></u></p></td><td width="71" nowrap valign="bottom" style="width:53.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">4.51<u></u><u></u></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">32<u></u><u></u></p></td><td width="63" nowrap valign="bottom" style="width:47.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">4677.02<u></u><u></u></p></td><td width="71" nowrap valign="bottom" style="width:53.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">2.71<u></u><u></u></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">16<u></u><u></u></p></td><td width="63" nowrap valign="bottom" style="width:47.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">4681.50<u></u><u></u></p></td><td width="71" nowrap valign="bottom" style="width:53.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">11.06<u></u><u></u></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">8<u></u><u></u></p></td><td width="63" nowrap valign="bottom" style="width:47.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">4660.23<u></u><u></u></p></td><td width="71" nowrap valign="bottom" style="width:53.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">12.47<u></u><u></u></p></td></tr><tr style="height:15.0pt"><td width="64" nowrap valign="bottom" style="width:48.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">0<u></u><u></u></p></td><td width="63" nowrap valign="bottom" style="width:47.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">4667.47<u></u><u></u></p></td><td width="71" nowrap valign="bottom" style="width:53.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:15.0pt"><p class="MsoNormal">8.63<u></u><u></u></p></td></tr></tbody></table><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">There are some minor fluctuations that I cannot explain, but we just have no compromise to make there: always insert the lifetime markers .<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks for your attention,<u></u><u></u></p><p class="MsoNormal"><span>--<u></u><u></u></span></p><p class="MsoNormal"><span>Arnaud A. de Grandmaison<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p></div></div><br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>