<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 23, 2015 at 12:12 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On 23 April 2015 at 14:17, Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br>
> I think the patch for LLVM looks okay, but not sure for the other one.<br>
><br>
> Your patch makes the linker to not be able to handle archive files<br>
> containing unaligned objects, or just makes it slower? If you cross-link an<br>
> executable for machines generous for unaligned accesses, say x86, on<br>
> not-so-generous machines, PowerPC for example, does it link fine?<br>
<br>
</span>Not difference on X86 (we avoid the copy).</blockquote><div><br></div><div>This has the potential to radically change LLD's physical/virtual memory usage characteristics depending on LLVM_IS_UNALIGNED_ACCESS_FAST (LIUAF) along with total memory traffic profile and disk access patterns. For example, this patch causes the entire file to be faulted in and read up front on !LIUAF whereas the file might be faulted and touched on disk sparsely and/or in a random order when LIUAF. Realistically most benchmarking and optimization work is going to happen on x86 and so performance on !LIUAF is likely to "bit rot" (we currently don't have any type of performance CI to avoid this; this is on my TODO list).</div><div><br></div><div>Have you tried copying the buffers on x86? Also, if you make sure that the incoming archives are aligned so you can avoid the copy on ppc, how much faster does it get? I.e. does (time saved from your patch on ppc)  == (time copying buffers with your patch on ppc) + (time saved if we use aligned archives and avoid the copy with your patch (for testing purposes))?</div><div><br></div><div>Can you dig in a bit deeper and figure out where this speedup is coming from? As it stands right now, this patch seems like a very opportunistic "seems to work on my machine" speedup.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> It makes the linker<br>
*faster* on powerpc:<br>
<span class=""><br>
trunk:  <a href="tel:2.165775601" value="+12165775601">2.165775601</a> seconds time elapsed ( +-  2.67% )<br>
<br>
patch: 1.979675092 seconds time elapsed  ( +-  2.96% )<br>
<br>
</span>The issue is that right now it leaks. Who should own the Archive in<br>
lld when using --whole-archive?<br>
<div class=""><div class="h5"><br>
Cheers,<br>
Rafael<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>