[lld] r286100 - [ELF] Make InputSection<ELFT>::writeTo virtual

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 03:16:12 PST 2016


SyntheticInput is not enough, because synthetic sections are written
on behalf of OutputSection<ELFT>, which maintains a list
of InputSection<ELFT> objects.

To my understanding an alternative is a check for section kind in
InputSection<ELFT>::writeTo, which is also a slow-down.
Will it be faster than virtual function call?

2016-11-08 14:11 GMT+03:00 Rafael EspĂ­ndola <rafael.espindola at gmail.com>:
> On 8 November 2016 at 05:44, Rafael EspĂ­ndola
> <rafael.espindola at gmail.com> wrote:
>> Why virtual and not a switch on Kind?
>>
>> It is odd to have two dispatch systems in the same type. This also
>> adds a vtable pointer to a pretty common class. Have you benchmarked
>> it?
>
> Reverting your patch I get:
>
>
> firefox
>   master 7.076592678
>   patch  7.045007685 1.00448331562x faster
> firefox-gc
>   master 7.272410408
>   patch  7.255948085 1.00226880386x faster
> chromium
>   master 4.886548772
>   patch  4.856506268 1.00618603217x faster
> chromium fast
>   master 1.817117752
>   patch  1.798675043 1.01025349691x faster
> the gold plugin
>   master 0.334146085
>   patch  0.334137857 1.00002462457x faster
> clang
>   master 0.566548508
>   patch  0.564552724 1.00353515963x faster
> llvm-as
>   master 0.033392083
>   patch  0.033195595 1.0059190986x faster
> the gold plugin fsds
>   master 0.363725583
>   patch  0.361394799 1.00644941213x faster
> clang fsds
>   master 0.649312555
>   patch  0.645128174 1.00648612348x faster
> llvm-as fsds
>   master 0.030836558
>   patch  0.030612317 1.00732518875x faster
> scylla
>   master 3.139408801
>   patch  3.143890138 1.00142744615x slower
>
> So it does look like at least constraining the vtable to the synthetic
> input classes would be a good thing. Can you take a look?
>
> Cheers,
> Rafael


More information about the llvm-commits mailing list