[PATCH] D45571: [ELF] - Speedup MergeInputSection::splitStrings

Rafael Avila de Espindola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 16 10:58:50 PDT 2018


espindola added a comment.

In https://reviews.llvm.org/D45571#1067496, @grimar wrote:

> In https://reviews.llvm.org/D45571#1067425, @espindola wrote:
>
> > It should also be possible to template Hash.h over the returned type so that some clients can explicitly request a 32 or 64 bit hash. Not sure if that change would be accepted.
>
>
> Do you know why it have to use size_t, btw? Given that hash_value falls back to short_hash that returns uint64_t, I wonder if it was intentional design or can be changed to always use uint64_t.


I think part of the reason is the desire to make the results unstable. The hashing API can return different results in different machines. If there is a hash algorithm that works better with AVX, that algorithm can be used if the host has AVX.

What we need is some form of signature/digest. We can change it as lld evolves, but it has to produce the same result in every host.


https://reviews.llvm.org/D45571





More information about the llvm-commits mailing list