<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-09-02 17:50 GMT-07:00 Piotr Padlewski <span dir="ltr"><<a href="mailto:piotr.padlewski@gmail.com" target="_blank">piotr.padlewski@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">2016-09-02 16:55 GMT-07:00 Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><span><blockquote type="cite"><div>On Sep 2, 2016, at 4:13 PM, Piotr Padlewski <<a href="mailto:piotr.padlewski@gmail.com" target="_blank">piotr.padlewski@gmail.com</a>> wrote:</div><br><div><div dir="ltr">The profile summary is saved in the global metadata ASAIK. If we want to calculate if something is hot/cold while choosing functions for importing, we would either need to read whole Module (which we clearly don't want to do)<div>or duplicate this information in the summary, so we could get it without reading Module.</div></div></div></blockquote><div><br></div></span><div>When I say “explain a bit more” I meant:</div><div><br></div></div></div></blockquote></span>Sure, I didn't know which part is not clear:<span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div></div><div>- what is the profile summary?</div></div></div></blockquote></span><div>Profile summary is additional metadata in LLVM calculated from FDO/aFDO data. </div><div>It is basically ProfileSummary class, having vector of ProfileSummaryEntry.</div><span class=""><div>  </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div>- how do you compute the hot/cold information from it and from the count we attache to edges?</div><div><br></div></div></div></blockquote></span><div>Having the ProfileCount from CalleeInfo, we can know what is the hotness of callsite (of the block). </div><div> - or at least the average hotness of basic blocks that calls give callee. (We probably want to change it </div><div>to std::max of callsite hotness later)</div></div></div></div></blockquote><div> Sorry, this problem will go away if we get rid of the ProfileCount from CalleeInfo.</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"><div class="gmail_quote"><div>Then having this information we can call ProfileSummaryInfo::<wbr>isHotCount() to find out if the callsite is hot,</div><div>which would probably mean that we want to inline callee to this basic block.</div><div>Right now Inliner only cares about the callee hotness, not callsite hotness, but this will change when</div><div>we will have new pass manager (the Easwaran patch depends on it).</div><div><br></div><div>Is that enough information? Fell free to ask some more, or ping me directly Mehdi.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Piotr</div></font></span><div><div class="h5"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div></div><div>— </div><span><font color="#888888"><div>Mehdi</div></font></span><div><div><br><blockquote type="cite"><div><div class="gmail_extra"><br><div class="gmail_quote">2016-09-02 15:49 GMT-07:00 Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><span><blockquote type="cite"><div>On Sep 2, 2016, at 3:16 PM, Piotr Padlewski <<a href="mailto:piotr.padlewski@gmail.com" target="_blank">piotr.padlewski@gmail.com</a>> wrote:</div><br><div><br><br style="font-family:helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_quote" style="font-family:helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">2016-09-02 15:04 GMT-07:00 Xinliang David Li<span> </span><span dir="ltr"><<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>On Fri, Sep 2, 2016 at 2:58 PM, Piotr Padlewski<br><<a href="mailto:piotr.padlewski@gmail.com" target="_blank">piotr.padlewski@gmail.com</a>> wrote:<br>> Hi,<br>> I am working right now on importing based on PGO/FDO data. There is one<br>> issue that I found - when we calculate the list of imports, we can't get the<br>> ProfileSummaryInfo, which is the best and I<br>> think only valid way of checking if callsite/callee is hot (isHotCount()).<br>> There are 2 solutions that I come up with Teresa and Easwaran:<br>><br>> 1. Add PGO data to summary<br>> 2. Replace CalleeInfo::ProfileCount with enum {None, Cold, Hot} computed<br>> during computing summary.<br><br><br></span>Don't we already have edge profile count in the callgraph summary?<br>I think what is missing is the Profile SUmmary data itself -- that one<br>should be copied over to thinLTO summary so that the importing<br>analysis can use. However I we should not need to duplicate the<br>information in every module.<br><span><font color="#888888"><br>David<br></font></span><div><div><br></div></div></blockquote><div>Yes we do have edge profile cout, but in order to compare it with global couts we need Profile Summary as you said. <br></div></div></div></blockquote><div><br></div></span><div>Can you explain a bit more the issue here?</div><div><br></div><div>Thanks,</div><div><br></div><div>Mehid</div><span><div><br></div><br><blockquote type="cite"><div><div class="gmail_quote" style="font-family:helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div>If we will follow 2) then we won't have to duplicate the data.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>><br>> I like the 2. much more. It will reduce the summary size slightly and I<br>> don't think we will need ProfileCount anywhere else.<br>><br>> The other thing I would like to mention is that I think we should start<br>> using the summary versioning and drop support of old version.<br>> ThinLTO doesn't have enough users right now and parsing many versions of<br>> summary will just add additional cost, that will start to grow.<br>><br>> Piotr</div></div></blockquote></div></div></blockquote></span></div><br></div></blockquote></div><br></div>
</div></blockquote></div></div></div><br></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>