<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 6, 2016 at 3:55 PM George Rimar <<a href="mailto:grimar@accesssoftek.com">grimar@accesssoftek.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif" class="gmail_msg">
<p class="gmail_msg"><span style="font-size:10pt;color:rgb(33,33,33)" class="gmail_msg">>On Thu, Oct 6, 2016 at 1:17 PM, George Rimar <<a href="mailto:grimar@accesssoftek.com" class="gmail_msg" target="_blank">grimar@accesssoftek.com</a>> wrote:</span><br class="gmail_msg">
</p>
</div><div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif" class="gmail_msg"><div style="color:rgb(33,33,33)" class="gmail_msg"><font size="2" class="gmail_msg"><span style="font-size:10pt" class="gmail_msg">
<div class="m_2298345930292801396PlainText gmail_msg">>>>There's an assertion here that the current implementation is not fast or<br class="gmail_msg">
>>> reusable. I'm not sure where that came from or what prompted it.<br class="gmail_msg">
>><br class="gmail_msg">
>>><br class="gmail_msg">
>>>Could you elaborate more on why you think these things?<br class="gmail_msg">
>>><br class="gmail_msg">
>>>-eric<br class="gmail_msg">
>><br class="gmail_msg">
>> I am not saying it is not reusable, but it definetely now do a bit more than<br class="gmail_msg">
>> we need in linker.<br class="gmail_msg">
>> Citation of myself from one of previous mails:<br class="gmail_msg">
>><br class="gmail_msg">
>> "short quick example:<br class="gmail_msg">
>> Imaging I want to get address ranges and so I want to use<br class="gmail_msg">
>> DWARFDebugInfoEntryMinimal::getAddressRanges(const DWARFUnit *U).<br class="gmail_msg">
>> For doing that I need DWARFUnit, which requires DWARFContext in constructor.<br class="gmail_msg">
>> Looking at comments that says<br class="gmail_msg">
>> "DWARFContextInMemory is the simplest possible implementation of a<br class="gmail_msg">
>> DWARFContext.", I am opening its constructor and<br class="gmail_msg">
>> see that it takes an object and do a scan over all sections uncompresses the<br class="gmail_msg">
>> compressed ones. But we do not need that as we already have<br class="gmail_msg">
>> content of sections available."<br class="gmail_msg">
>><br class="gmail_msg">
>> That this and possible other places need rework if we are want fastest<br class="gmail_msg">
>> solution for lld.<br class="gmail_msg">
>><br class="gmail_msg">
><br class="gmail_msg">
>I'm a little bit skeptical. It's not sure if the scan is a source of<br class="gmail_msg">
>significant slowdown at link-time (it could possibly be, but we don't<br class="gmail_msg">
>have the figures yet). Also, is there anything that prevents the API<br class="gmail_msg">
>in LLVM to be changed so that the performance hit (if any) can be<br class="gmail_msg">
>avoided? I'd rather try going that route, if possible.<br class="gmail_msg">
><br class="gmail_msg">
>--<br class="gmail_msg">
>Davide<br class="gmail_msg">
</div>
<div class="m_2298345930292801396PlainText gmail_msg"><br class="gmail_msg">
</div>
</span></font></div></div><div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif" class="gmail_msg"><div style="color:rgb(33,33,33)" class="gmail_msg"><font size="2" class="gmail_msg"><span style="font-size:10pt" class="gmail_msg"><div class="m_2298345930292801396PlainText gmail_msg">It is not just scan. It uncompresses sections, what I think we do not need in linker as we should have them uncomressed already.<br class="gmail_msg"></div></span></font></div></div></blockquote><div><br></div><div>What should be decompressing them?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif" class="gmail_msg"><div style="color:rgb(33,33,33)" class="gmail_msg"><font size="2" class="gmail_msg"><span style="font-size:10pt" class="gmail_msg"><div class="m_2298345930292801396PlainText gmail_msg">
</div>
<div class="m_2298345930292801396PlainText gmail_msg">Then it tries to proccess relocations for many debug sections, what is also seems excessive for gdb_index section build needs.<br class="gmail_msg"></div></span></font></div></div></blockquote><div><br></div><div>This is probably true though. (Mostly, you'll need to resolve some of the relocations in the compile unit).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif" class="gmail_msg"><div style="color:rgb(33,33,33)" class="gmail_msg"><font size="2" class="gmail_msg"><span style="font-size:10pt" class="gmail_msg"><div class="m_2298345930292801396PlainText gmail_msg">
<br class="gmail_msg">
</div>
<div class="m_2298345930292801396PlainText gmail_msg">To clarify - I am not trying to say it is slow (I did not compare or run benchmarks and I am not really familar with it), but I guess it should be slower</div>
<div class="m_2298345930292801396PlainText gmail_msg">than what I do in the patch just because it do a bit more job now. <span style="font-size:10pt" class="gmail_msg">What sure </span><span style="font-size:10pt" class="gmail_msg">can be changed.</span></div>
<div class="m_2298345930292801396PlainText gmail_msg"><br class="gmail_msg">
</div>
<div class="m_2298345930292801396PlainText gmail_msg">So Eric, David, if you guys think it is better to reimplement patch to reuse existent API - I think I am ready to try that.<br class="gmail_msg">
</div>
<div class="m_2298345930292801396PlainText gmail_msg">If we can land patch as is and switch later - that also works for me.<br class="gmail_msg">
</div></span></font></div></div><div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif" class="gmail_msg"><div style="color:rgb(33,33,33)" class="gmail_msg"><font size="2" class="gmail_msg"><span style="font-size:10pt" class="gmail_msg">
<div class="m_2298345930292801396PlainText gmail_msg"><br class="gmail_msg"></div></span></font></div></div></blockquote><div><br></div><div>I'd prefer not to have any more debug readers than necessary. If you need additional API entry points in the debug information it seems like a good idea to add them as well.</div><div><br></div><div>Thanks!</div><div><br></div><div>-eric</div><div> </div></div></div>