<div dir="ltr"><div class="gmail_extra"><div><div class="gmail_signature">On Mon, Jul 31, 2017 at 5:26 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I updated the patch to read a call graph from a text file.<br>
<br>
I tested it with the attached call.txt from lld linking chromium.<br>
Unfortunately the resulting lld doesn't seem any faster. One thing I<br>
noticed is that the most used symbols seem to be at the end of the<br>
file.<br></blockquote><div><br></div><div>Not all programs will get faster as it really depends on the working set size of the code. While lld is kinda large, if you're not running LTO then the instruction working set is pretty small.</div><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">
<br>
In any case, can you add tests and send the lld patch for review?<br></blockquote><div><br></div><div>Yep, should have that tomorrow.</div><div><br></div><div>- Michael Spencer<br></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">
<br>
Thanks,<br>
Rafael<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br>
<br>
On 31 July 2017 at 15:19, Davide Italiano <<a href="mailto:davide@freebsd.org">davide@freebsd.org</a>> wrote:<br>
> I'm definitely interested in seeing this moving forward, (phabricator<br>
> will make the review easy), quick question, why the option is phrased<br>
> as negative? (i.e. --disable instead of --enable?)<br>
><br>
> Thanks,<br>
><br>
> --<br>
> Davide<br>
><br>
> On Mon, Jul 31, 2017 at 3:12 PM, Rafael Espíndola via llvm-dev<br>
> <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> A rebased version of the lld patch is attached.<br>
>><br>
>> Cheers,<br>
>> Rafael<br>
>><br>
>><br>
>> On 31 July 2017 at 15:11, Rafael Avila de Espindola<br>
>> <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
>>> Tobias Edler von Koch <<a href="mailto:tobias@codeaurora.org">tobias@codeaurora.org</a>> writes:<br>
>>><br>
>>>> Hi Rafael,<br>
>>>><br>
>>>> On 07/31/2017 04:20 PM, Rafael Avila de Espindola via llvm-dev wrote:<br>
>>>>> However, do we need to start with instrumentation? The original paper<br>
>>>>> uses sampling with good results and current intel cpus can record every<br>
>>>>> branch in a program.<br>
>>>>><br>
>>>>> I would propose starting with just an lld patch that reads the call<br>
>>>>> graph from a file. The format would be very similar to what you propose,<br>
>>>>> just weight,caller,callee.<br>
>>>><br>
>>>> The advantage of the proposed approach (weighted callgraph section) is<br>
>>>> that it's completely transparent: it works regardless of the particular<br>
>>>> profiling methodology (as long as there's !perf metadata when the pass<br>
>>>> runs). For this reason, it fits neatly into an *existing* PGO-based<br>
>>>> build flow. I only need to add 1 compiler flag to enable it. That's a<br>
>>>> big plus.<br>
>>>><br>
>>>> On the other hand, I could see how your idea (callgraph input file for<br>
>>>> linker) would be useful in situations where I just want to do section<br>
>>>> layout but no PGO in the compiler... and of course for testing of the<br>
>>>> linker's sorting algorithm.<br>
>>>><br>
>>>> So there's merits in both, but for my use cases Michael's original<br>
>>>> approach is the most practical.<br>
>>><br>
>>> Yes, I must stress that I am not proposing having the option of reading<br>
>>> the callgraph from another file *instead* of reading it from .o<br>
>>> files. Just that doing it first decouples most of the lld patch form the<br>
>>> llvm changes and can be useful in cases where only samples are available.<br>
>>><br>
>>> Cheers,<br>
>>> Rafael<br>
>><br>
>> ______________________________<wbr>_________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> Davide<br>
><br>
> "There are no solved problems; there are only problems that are more<br>
> or less solved" -- Henri Poincare<br>
</div></div></blockquote></div><br></div></div>