<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 16, 2017, at 1:47 PM, Sean Silva <<a href="mailto:chisophugis@gmail.com" class="">chisophugis@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Mon, Jan 16, 2017 at 1:25 PM, Davide Italiano<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:davide@freebsd.org" target="_blank" class="">davide@freebsd.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><span class="gmail-">On Mon, Jan 16, 2017 at 12:31 PM, Sean Silva via llvm-dev<br class=""><<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class="">> Do we have any open projects on LLD?<br class="">><br class="">> I know we usually try to avoid any big "projects" and mainly add/fix things<br class="">> in response to user needs, but just wondering if somebody has any ideas.<br class="">><br class=""><br class=""></span>I'm not particularly active in lld anymore, but the last big item I'd<br class="">like to see implemented is Pettis-Hansen layout.<br class=""><a href="http://perso.ensta-paristech.fr/~bmonsuez/Cours/B6-4/Articles/papers15.pdf" rel="noreferrer" target="_blank" class="">http://perso.ensta-paristech.<wbr class="">fr/~bmonsuez/Cours/B6-4/<wbr class="">Articles/papers15.pdf</a><br class="">(mainly because it improves performances of the final executable).<br class="">GCC/gold have an implementation of the algorithm that can be used as<br class="">base. I'll expand if anybody is interested.<br class="">Side note: I'd like to propose a couple of llvm projects as well, I'll<br class="">sit down later today and write them.<br class=""></blockquote><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>I’m not sure, can you confirm that such layout optimization on ELF requires -ffunction-sections?</div><div><br class=""></div><div>Also, for clang on OSX the best layout we could get is to order functions in the order in which they get executed at runtime.</div><div> </div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="">For FullLTO it is conceptually pretty easy to get profile data we need for this, but I'm not sure about the ThinLTO case.</div><div class=""><br class=""></div><div class="">Teresa, Mehdi,</div><div class=""><br class=""></div><div class="">Are there any plans (or things already working!) for getting profile data from ThinLTO in a format that the linker can use for code layout? I assume that profile data is being used already to guide importing, so it may just be a matter of siphoning that off.</div></div></div></blockquote><div><br class=""></div><div>I’m not sure what kind of “profile information” is needed, and what makes it easier for MonolithicLTO compared to ThinLTO?</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="">Or maybe that layout code should be inside LLVM; maybe part of the general LTO interface? It looks like the current gcc plugin calls back into gcc for the actual layout algorithm itself (function call find_pettis_hansen_function_layout) rather than the reordering logic living in the linker: <a href="https://android.googlesource.com/toolchain/gcc/+/3f73d6ef90458b45bbbb33ef4c2b174d4662a22d/gcc-4.6/function_reordering_plugin/function_reordering_plugin.c" class="">https://android.googlesource.com/toolchain/gcc/+/3f73d6ef90458b45bbbb33ef4c2b174d4662a22d/gcc-4.6/function_reordering_plugin/function_reordering_plugin.c</a></div></div></div></blockquote><div><br class=""></div><div>I was thinking about this: could this be done by reorganizing the module itself for LTO?</div><div><br class=""></div><div>That wouldn’t help non-LTO and ThinLTO though.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><br class=""></div><div class="">-- Sean Silva</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><br class="">--<br class="">Davide<br class=""><br class="">"There are no solved problems; there are only problems that are more<br class="">or less solved" -- Henri Poincare</blockquote></div></div></blockquote></div><br class=""></body></html>