<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Many thanks for commenting on the ThinLTO part and the suggestions how to approach this!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I also think that specialisation benefits the out of line copy. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Cheers,<br>
Sjoerd.</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Teresa Johnson <tejohnson@google.com><br>
<b>Sent:</b> 27 July 2021 16:00<br>
<b>To:</b> Sjoerd Meijer <Sjoerd.Meijer@arm.com><br>
<b>Cc:</b> llvm-dev <llvm-dev@lists.llvm.org>; Florian Hahn <florian_hahn@apple.com>; chuanqi.xcq <yedeng.yd@linux.alibaba.com><br>
<b>Subject:</b> Re: [llvm-dev] [ThinLTO] Import functions to enable function specialization in ThinLTO</font>
<div> </div>
</div>
<div>
<div dir="ltr">I can answer questions from the ThinLTO standpoint. Missed the earlier emails on this, but I just skimmed the other llvm-dev email and the patch. I have a high level question and can give some thoughts on the approach from a ThinLTO standpoint.
<div><br>
</div>
<div>One important thing to note is that we import functions with available_externally linkage, because they still live in their original translation unit. The intention is to make them available for inlining, and then they get dropped. But specialization presumably
 mainly benefits the out of line copy, I think? So I'm not sure that the approach of allowing the specialization candidates to get imported will ultimately do what you want. It probably would be better to allow the necessary info to be propagated via the index
 back to the original TU so that it can be specialized in its original location.</div>
<div><br>
</div>
<div>Agree with others that the solution should be prototyped so you can show some results in terms of not only the benefit, but also the cost. I.e. adding information about all of the function arguments will increase the size of the index - how significant
 is that increase? We want to ensure that the thin link portion of the ThinLTO build stays efficient as that is the only monolithic, serial portion of a ThinLTO build. That being said, I think it is a great idea to try to extend function specialization to ThinLTO
 if it is giving good benefits with regular LTO.</div>
<div><br>
</div>
<div>Teresa</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, Jul 27, 2021 at 5:56 AM Sjoerd Meijer via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
The motivation for this work was getting this working ThinLTO, which I know very little about that, so that's why I recommended getting buy in from ThinLTO folks for the general direction.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
This general direction is that we change the cost-model, import more functions as a result, so that we can do more transformations. The questions that need answering are: what is this going to cost in compile-times, and what is the performance benefit?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
To have a more efficient discussion on this, I think it is best if you prototype your proposal. This makes things more concrete and also allows to get some first costs and benefits of the approach to test the whole idea. Without this, it all just remains a
 bit abstract.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div style="margin:0px; font-size:15px; color:rgb(32,31,30); clear:both"><span style="margin:0px; font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:black"><span style="margin:0px; background-color:rgb(255,255,255); display:inline; font-family:calibri,arial,helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Regarding
</span><span style="margin:0px; background-color:white; display:inline"><a href="https://reviews.llvm.org/D105524" rel="noopener noreferrer" target="_blank" style="margin:0px">https://reviews.llvm.org/D105524</a></span><span style="margin:0px; background-color:rgb(255,255,255); display:inline; font-family:calibri,arial,helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">,
 yes </span></span><span style="font-family:calibri,arial,helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">it is NFC and harmless, but it is not important. I.e., it is trivial and I'm sure we can get it approved in
 no-time, but more important are the bigger questions that needs answers first. It's also better to avoid unnecessary churn if things turns out to be different.</span></div>
<div style="margin:0px; font-size:15px; color:rgb(32,31,30); clear:both"><span style="font-family:calibri,arial,helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)"><br>
</span></div>
<div style="margin:0px; font-size:15px; color:rgb(32,31,30); clear:both"><span style="font-family:calibri,arial,helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">My 2 cents.</span></div>
<div style="margin:0px; font-size:15px; color:rgb(32,31,30); clear:both"><span style="font-family:calibri,arial,helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">Sjoerd.</span></div>
</div>
<div id="x_gmail-m_4179446858562089319appendonsend"></div>
<hr style="display:inline-block; width:98%">
<div id="x_gmail-m_4179446858562089319divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>>
 on behalf of chuanqi.xcq via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br>
<b>Sent:</b> 26 July 2021 07:30<br>
<b>To:</b> llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>; Florian Hahn <<a href="mailto:florian_hahn@apple.com" target="_blank">florian_hahn@apple.com</a>><br>
<b>Subject:</b> Re: [llvm-dev] [ThinLTO] Import functions to enable function specialization in ThinLTO</font>
<div> </div>
</div>
<div>
<div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">gentle ping~</span></div>
<blockquote style="margin-right:0px; margin-top:0px; margin-bottom:0px">
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">------------------------------------------------------------------</span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">From:llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">Send Time:2021年7月15日(星期四) 17:23</span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">To:llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>; Florian Hahn <<a href="mailto:florian_hahn@apple.com" target="_blank">florian_hahn@apple.com</a>></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">Subject:Re: [llvm-dev] [ThinLTO] Import functions to enable function specialization in ThinLTO</span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><br>
</span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">Hi <span style="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">Florian,</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">Thanks
 for looking into this!</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">> I’d
 try to summarise the heuristics you propose to add, rather than focusing on the implementation details to start with.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both">Thanks. I agree with it. The direction are more important than details.</div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both">> <span style="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">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.</span></div>
<div style="clear:both"><span style="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"><br>
</span></div>
<div style="clear:both"><span style="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">If
 I understand right, you mean that I could collect these numbers after we summarised the heuristics we decide to use instead of collecting now.</span></div>
<div style="clear:both"><span style="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">Collecting
 the numbers may not make sense to me. Since I think we should do statistics after we decided the direction.</span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">> Also,
 the scope/focus on function specialisation seems a bit narrow for substantially increasing the number of imported functions.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">I
 think there are two apsects.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">-
 It depends on how much we could get from function specialization.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">-
 It depends the cost model to import more functions.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">For
 the first aspects, I think function specialization is potential because ipa-cp plays an important role in gcc.
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">And
 the interprocedural value range propogation based on function specialization seems very potential to me.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">That's
 the reason that I want to look into function specialization.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">For
 the second aspects, I think we need more time to tuning it. Or in another words, we need to decide the heuristics first.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">I
 know it's hard to **decide**  heuristics without measuring. But the work process  I imaged maybe:</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">```</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">Get
 a set of heuristics -> Tuning the cost model to decrease the overhead -> if succed, we got it -> else go back to the first step.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">```</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">> Do
 you think the proposed heuristics would also benefit other optimisations, like regular IPSCCP?</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">Yes,
 I think regular IPSCCP could benefit from the proposed heuristics. Out of curiousty, I guess we could replace regular IPSCCP</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">once
 the function specialization pass is strong enough. What's your opinion?</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">Finally,
 let me clarify the intention of this mail. I don't ask to get a solution right now. I know it is hard for every one.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">The
 intention is that if we could get a consensus that it is valuable that importing functions by heuristics for function specialization.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">If
 yes, we could continue the review process for <a href="https://reviews.llvm.org/D105524" target="_blank">https://reviews.llvm.org/D105524</a>, which extract the analysis part from function
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">specialization
 pass. I believe this patch should be NFC and harmless.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">Of
 course, it could much much better that we could discuss the heuristics and the cost model.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">Let
 me introduce the heuristics and the cost model I proposed simply.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">The heuristics
 are:</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"></span></span>
<ul style="font-style:normal; font-variant-caps:normal; font-weight:normal; text-indent:0px; text-transform:none; text-decoration:none; margin:12px 0px 12px 30px; padding:0px; border:0px; list-style:disc; color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px; text-align:left">
<li style="margin:0px; padding:0px; border:0px; line-height:1.7em">Specialize Function Cost. An unsigned number, which is an estimation for the cost to clone one function.</li><li style="margin:0px; padding:0px; border:0px; line-height:1.7em">Base Bonus for specializing specific argument. A map from ArgNo to the corresponding base bonus. Here the base bonus means the bonus we could calculate by visiting the function body itself only
 (in other words, doesn't need to see the call site).</li><li style="margin:0px; padding:0px; border:0px; line-height:1.7em">ArgUsage. A map from ArgNo to the extra bonus for each call site. The extra bonus means the bonus we could calculate for specific call site. For example, if we passed a function in the call,
 we could calculate the possibility that the function could get inlined at the specific call site only.</li></ul>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">And the cost model are the same with function specialization pass right now and we could adjust it in the future.</span></div>
</div>
<div style="clear:both">
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">The first one `<span style="color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px; font-style:normal; font-variant-caps:normal; font-weight:normal; text-align:left; text-indent:0px; text-transform:none; background-color:rgb(255,255,255); text-decoration:none; float:none; display:inline">Specialize
 Function Cost</span>` is the number of instruction in a function multiplies a factor.</span></div>
</div>
<div style="clear:both">
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">The second one `Base Bonus` is calculated by how many possible loads for this argument and its alias now.
</span></div>
</div>
<div style="clear:both">
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">I plan to add more situations for example:</span></div>
</div>
<div style="clear:both">
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">```</span></div>
</div>
<div style="clear:both">
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">int foo(bool cond) {</span></div>
</div>
<div style="clear:both">
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">   if (cond) { // We could get more base bonus by the average instruction count in the branches.</span></div>
</div>
<div style="clear:both">
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">   } else {</span></div>
</div>
<div style="clear:both">
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">   }</span></div>
</div>
<div style="clear:both">
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">}</span></div>
</div>
<div style="clear:both">
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">```</span></div>
</div>
<div style="clear:both">
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">Or</span></div>
</div>
<div style="clear:both">
<div style="clear:both">
<div style="margin:0px; padding:0px; border:0px; outline:0px; 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; clear:both">
<div style="margin:0px; padding:0px; border:0px; outline:0px; clear:both"><span style="margin:0px; padding:0px; border:0px; outline:0px; font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">```</span></div>
</div>
<div style="margin:0px; padding:0px; border:0px; outline:0px; 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; clear:both">
<div style="margin:0px; padding:0px; border:0px; outline:0px; clear:both"><span style="margin:0px; padding:0px; border:0px; outline:0px; font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">int foo(int cond) {</span></div>
</div>
<div style="margin:0px; padding:0px; border:0px; outline:0px; 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; clear:both">
<div style="margin:0px; padding:0px; border:0px; outline:0px; clear:both"><span style="margin:0px; padding:0px; border:0px; outline:0px; font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">   if (cond > 10) { // We could get the condition
 if cond is constant, so we could get more bonus.</span></div>
</div>
<div style="margin:0px; padding:0px; border:0px; outline:0px; 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; clear:both">
<div style="margin:0px; padding:0px; border:0px; outline:0px; clear:both"><span style="margin:0px; padding:0px; border:0px; outline:0px; font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">   } else {</span></div>
</div>
<div style="margin:0px; padding:0px; border:0px; outline:0px; 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; clear:both">
<div style="margin:0px; padding:0px; border:0px; outline:0px; clear:both"><span style="margin:0px; padding:0px; border:0px; outline:0px; font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">   }</span></div>
</div>
<div style="margin:0px; padding:0px; border:0px; outline:0px; 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; clear:both">
<div style="margin:0px; padding:0px; border:0px; outline:0px; clear:both"><span style="margin:0px; padding:0px; border:0px; outline:0px; font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">}</span></div>
</div>
<div style="margin:0px; padding:0px; border:0px; outline:0px; 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; clear:both">
<div style="margin:0px; padding:0px; border:0px; outline:0px; clear:both"><span style="margin:0px; padding:0px; border:0px; outline:0px; font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">```</span></div>
</div>
</div>
</div>
<div style="clear:both">
<div style="clear:both">
<div style="margin:0px; padding:0px; border:0px; outline:0px; 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; clear:both">
<div style="margin:0px; padding:0px; border:0px; outline:0px; clear:both"><span style="margin:0px; padding:0px; border:0px; outline:0px; font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"></span></div>
</div>
<span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">The third one `<span style="color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:13px; font-style:normal; font-variant-caps:normal; font-weight:normal; text-align:left; text-indent:0px; text-transform:none; background-color:rgb(255,255,255); text-decoration:none; float:none; display:inline">ArgUsage</span>`,
 which describes the infomation in callsites and we could use it to calculate the extra bonus.</span></div>
</div>
<div style="clear:both">
<div style="clear:both">Now it only contains the instruction count if the corresponding parameter is a function. Then we could get extra bonus</div>
</div>
<div style="clear:both">
<div style="clear:both">from the potential inlining.</div>
</div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"></span></span></div>
<div style="clear:both"><br>
</div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">Thanks,</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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">Chuanqi</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">------------------------------------------------------------------</span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">From:Florian Hahn <<a href="mailto:florian_hahn@apple.com" target="_blank">florian_hahn@apple.com</a>></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">Send Time:2021年7月14日(星期三) 19:39</span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">To:chuanqi.xcq <<a href="mailto:yedeng.yd@linux.alibaba.com" target="_blank">yedeng.yd@linux.alibaba.com</a>>; llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)">Subject:Re: [llvm-dev] [ThinLTO] Import functions to enable function specialization in ThinLTO</span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px; color:rgb(0,0,0)"><br>
</span></div>
<br>
<div><br>
<div>On 14 Jul 2021, at 09:38, chuanqi.xcq via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div>
<br>
<div>
<div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px">Hi all,</span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px"><br>
</span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px">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"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px">Maybe the question is too empty or the <span style="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">function
 specialization pass didn't get checked in at that time. So I didn't get responses.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px"><span style="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">Then
 now, the function specialization passes got checked in and I also made it a version in the downstream.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px"><span style="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">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></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px"><span style="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">(<a href="https://reviews.llvm.org/D105524" target="_blank">https://reviews.llvm.org/D105524</a>).</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px"><span style="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">And
<span title="sjoerd.meijer@arm.com" style="border:none; margin:0px 2px 0px 0px; background-color:transparent; color:rgb(2,132,192)">
@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></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px"><span style="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">in
 the right direction.</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px"><span style="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"><br>
</span></span></div>
<div style="clear:both"><span style="font-family:Tahoma,Arial,STHeiti,SimSun; font-size:14px"><span style="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">Then
 I updated this one: <a href="https://reviews.llvm.org/D105966" target="_blank">https://reviews.llvm.org/D105966</a>, which contains the detailed description and numbers.</span></span></div>
<div style="clear:both">Response in this thread or in that review page is fine to me either.</div>
<div style="clear:both"><br>
</div>
</div>
</div>
<br>
</div>
<div><br>
</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>
</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>
</div>
<div>Cheers,</div>
<div>Florian</div>
<br>
<div><br>
</div>
</blockquote>
</div>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr">
<div><span style="font-family:Times; font-size:medium">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="color:rgb(85,85,85); font-family:sans-serif; font-size:small">
<td nowrap="" style="border-top:2px solid rgb(213,15,37)">Teresa Johnson |</td>
<td nowrap="" style="border-top:2px solid rgb(51,105,232)"> Software Engineer |</td>
<td nowrap="" style="border-top:2px solid rgb(0,153,57)"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td>
<td nowrap="" style="border-top:2px solid rgb(238,178,17)"><br>
</td>
</tr>
</tbody>
</table>
</span></div>
</div>
</div>
</div>
</body>
</html>