[PATCH] D60765: [ELF] Place SectionPiece::{Live,Hash} bit fields together

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 17 00:39:12 PDT 2019


ruiu added a comment.

In D60765#1469717 <https://reviews.llvm.org/D60765#1469717>, @MaskRay wrote:

>   uint32_t Hash;
>   uint8_t Live : 1;
>   uint8_t TailShardId : 5;
>   uint8_t OutputOffHi;
>   uint32_t OutputOffLo;
>
>
> Do you mean
>
>   // 16 bytes -> 12 bytes
>   uint32_t InputOff;
>  
>   uint32_t Live : 1
>   uint32_t Hash : 18;
>   uint32_t TailShardId : 5;
>   uint32_t OutputOffHi : 8;
>  
>   uint32_t OutputOffLo;
>
>
> Looks fine.


Reducing the size to 12 bytes looks like a good idea, but I'm worried if 18 bits hash may be too short. This hash value will be used to determine a bucket in a hash table, so reducing the number of hash bits means that we'll likely to have more collisions.


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D60765





More information about the llvm-commits mailing list