[PATCH] Improve linker performance (v2)

Renato Golin renato.golin at linaro.org
Tue May 28 02:36:18 PDT 2013


On 28 May 2013 10:26, James Molloy <James.Molloy at arm.com> wrote:

> I understand that there's only one use of this functionality so far, but
> considered that (a) demand-value-generation may be useful to other
> (potentially out of tree) consumers, because the RemapInstruction interface
> is used widely and (b) RemapInstruction is sufficiently complex that
> rewriting it just for the linker would be worse practice.
>

This is a good argument. ;)


I agree. Actually ValueMaterializerTy is what in C++11 would be defined as
> a final class. It extends ValueMaterializer and is the last implementation
> in the hierarchy. It is a concrete class specific to the linker, and
> requires access to multiple pieces of the linker state, which is why I saw
> fit to grant it friend status.
>

Yes, the only times where I let myself use friend, even knowing that it
wasn't the more elegant solution, was when working around issues in either
the compiler (newer GCC being more strict) or the language.


I can change this to pass references to everything it needs in the
> constructor however, if you feel that's a better solution!
>

I trust you on that. Feel free to do it locally and revert to use friend if
not helpful. It won't be the first use of friend in LLVM... ;)


This is true, apologies. I'll attempt to distill down a regression test (it
> took quite a bit of distilling to just get it to a state where I could
> understand what was going on :()
>

It took me a while to understand your patch, as well... Not that it's
complex per se, but what's involved around (and outside) the patch is not
linear. ;)

Nevertheless, thanks for the patch, 45% on large modules is a great
improvement!

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130528/3cca45c7/attachment.html>


More information about the llvm-commits mailing list