<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 14 Jul 2021, at 09:38, chuanqi.xcq via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="__aliyun_email_body_block"><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class="">Hi all,</span></div><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><br class=""></span></div><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class="">Before I sent a mail to ask the opinion to how to import functions to enable function specialization in ThinLTO.</span></div><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class="">Maybe the question is too empty or the <span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class="">function specialization pass didn't get checked in at that time. So I didn't get responses.</span></span></div><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class=""><br class=""></span></span></div><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class="">Then now, the <span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class="">function specialization passes got checked in and I also made it a version in the downstream.</span></span></span></div><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class="">So I tried to update my patches. The first patch is to extract the analysis part of function specialization as an analysis pass.</span></span></span></div><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class="">(<a href="https://reviews.llvm.org/D105524" class="">https://reviews.llvm.org/D105524</a>).</span></span></span></div><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class=""><br class=""></span></span></span></div><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class="">And <span class="__aliyun_at_block_1626247728691 __aliyun_at_block_" title="sjoerd.meijer@arm.com" style="border:none;margin:0 2.0px 0 0;background-color:transparent;color:#0284c0;">@sjoerd.meijer</span> suggests that it may be better that I ping this thread with more infomation to make us confident we are</span></span></span></div><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class="">in the right direction.</span></span></span></div><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class=""><br class=""></span></span></span></div><div style="clear:both;" class=""><span style="font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Tahoma, Arial, STHeiti, SimSun; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; text-align: start; text-indent: 0px; text-transform: none; background-color: rgb(255, 255, 255); text-decoration: none; float: none; display: inline;" class="">Then I updated this one: <a href="https://reviews.llvm.org/D105966" class="">https://reviews.llvm.org/D105966</a>, which contains the detailed description and numbers.</span></span></span></div><div style="clear:both;" class="">Response in this thread or in that review page is fine to me either.</div><div style="clear:both;" class=""><br class=""></div></div></div></blockquote><br class=""></div><div><br class=""></div><div>I’d try to summarise the heuristics you propose to add, rather than focusing on the implementation details to start with. I think it might be helpful to motivate a set of heuristics first. You should also be able to collect and provide date on the effectiveness of those heuristics, like the number of additional functions imported, compared to the number of additionally specialised  functions.</div><div><br class=""></div><div>Also, the scope/focus on function specialisation seems a bit narrow for substantially increasing the number of imported functions. Do you think the proposed heuristics would also benefit other optimisations, like regular IPSCCP?</div><div><br class=""></div><div>Cheers,</div><div>Florian</div><br class=""></body></html>