[lld] r319518 - Add an additional test for r319503.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 12:41:25 PST 2017


On Fri, Dec 1, 2017 at 9:47 AM, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> Rui Ueyama via llvm-commits <llvm-commits at lists.llvm.org> writes:
>
> > Author: ruiu
> > Date: Thu Nov 30 20:46:56 2017
> > New Revision: 319518
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=319518&view=rev
> > Log:
> > Add an additional test for r319503.
> >
> > Added:
> >     lld/trunk/test/ELF/gnu-hash-table-many.s
> >
> > Added: lld/trunk/test/ELF/gnu-hash-table-many.s
> > URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/
> gnu-hash-table-many.s?rev=319518&view=auto
> > ============================================================
> ==================
> > --- lld/trunk/test/ELF/gnu-hash-table-many.s (added)
> > +++ lld/trunk/test/ELF/gnu-hash-table-many.s Thu Nov 30 20:46:56 2017
> > @@ -0,0 +1,55 @@
> > +# REQUIRES: x86
> > +
> > +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
> > +# RUN: ld.lld -hash-style=gnu %t.o -o %t.so -shared
> > +# RUN: llvm-readelf --gnu-hash-table %t.so | FileCheck %s
> > +
> > +# CHECK: Num Buckets: 4
>
> Thanks. BTW, out bloom filter still seems to be larger than gold or
> bfd. When linking clang I get
>
> lld:
>
>   Num Mask Words: 8192
>
> gold and bfd:
>   Num Mask Words: 4096
>

It's hard to say whether we should shrink our bloom filter or not.

When I link clang, gold produces a 64 KiB bloom filter for 88,850 symbols
while lld produces a 128 KiB bloom filter for the same number of symbols.

If you compute the probability of false positive [1], the 128 KiB bloom
filter that the GNU linker produced has 8.3% false positive rate [2] while
our 128 KiB filter has 2.4% [3]. To me, 8.3% seems too high, so I'd keep
our code as-is, but ideally we should do some benchmark.

[1]
https://en.wikipedia.org/wiki/Bloom_filter#Probability_of_false_positives
[2]
https://www.wolframalpha.com/input/?i=(1-e%5E(-kn%2Fm))%5Ek+where+m%3D8192*64,+k%3D2,+n%3D88850
[3]
https://www.wolframalpha.com/input/?i=(1-e%5E(-kn%2Fm))%5Ek+where+m%3D16384*64,+k%3D2,+n%3D88850
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171201/b107df4f/attachment.html>


More information about the llvm-commits mailing list