[PATCH] D55971: [ELF] .gnu.hash bloom filter: use Shift2 = 26 instead of 2

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 20 17:01:55 PST 2018


ruiu added inline comments.


================
Comment at: ELF/SyntheticSections.cpp:2181-2182
     uint64_t Val = readUint(Buf + I * Config->Wordsize);
+    // We choose Shift2 = 26 to give us high 6 bits for the 64-bit case,
+    // (nearly) independent from the low 6 bits, and thus less collision.
     Val |= uint64_t(1) << (Sym.Hash % C);
----------------
This is perhaps not the best place to write a comment because it's a bit too deep inside a loop. You probably should give a broader view for a reader.

I'd explain that we choose a word using bit [MaskWords+6 : 6] and set 1 to two bits in the word using bit [0:5] and [26:31].


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55971/new/

https://reviews.llvm.org/D55971





More information about the llvm-commits mailing list