<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 24, 2015 at 1:13 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</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 class="gmail_extra"><span class=""><br><div class="gmail_quote">On Tue, Mar 24, 2015 at 1:08 PM, Xinliang David Li <span dir="ltr"><<a href="mailto:xinliangli@gmail.com" target="_blank">xinliangli@gmail.com</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">Example. Assuming the cap is 'C'<div><br></div><div>void bar()</div><div>{</div><div>    // ENTRY count is 4*C, after capping it becomes 'C'</div><div>    ...</div><div>}</div><div><br></div><div>void test()</div><div>{</div><div>  // BB1:   count(BB1) = C</div><div>  bar();</div><div><br></div><div><div>  // BB2:   count(BB2) = C</div><div>  bar();</div></div><div><br></div><div>}</div><div><br></div><div><div>void test2()</div><div>{</div><div>  // BB3:   count(BB3) = C</div><div>  bar();</div><div><br></div><div><div>  // BB4:   count(BB4) = C</div><div>  bar();</div></div><div>}</div></div><div><br></div><div>What would inliner see here ? When it sees callsite1 -- it might mistaken that is the only dominating callsite to 'bar'.</div></div></blockquote></div><br></span>I don't understand, why would it assume this?</div></div></blockquote><div><br></div><div>because </div><div><br></div><div>count(ENTRY_bar) = SUM (count(callsite_i(bar)), for all i.</div><div><br></div><div>If the inliner sees the first callsite has the same count as the bar's entry count, what assumption can it make (especially when the module has only one callsite to be looked at)? With more callsites visible, it can detect the insanity, but still it makes the data less useful.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br></div><div class="gmail_extra">I was suggesting that each function would need to be associated with some global weight, and the global weight ration between test and bar should provide the needed information here?</div></div></blockquote><div><br></div><div>See my previous reply. The data is there. We just need to preserve it.</div><div><br></div><div>David</div><div> </div></div><br></div></div>