[PATCH] D51887: lld-link: Set PDB GUID to hash of PDB contents instead of to a random byte sequence.

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 10 16:22:45 PDT 2018


rnk added a comment.

In https://reviews.llvm.org/D51887#1229530, @ruiu wrote:

> I wonder if you can just compute a hash for a mmap'ed PDB file instead of defining a new type of Stream. That's what we do for ELF when computing a build-id, and I found that's easy to do. It is also easy to parallelize hash computation by making it a tree hash.


If we use a streaming interface to write the file in the first place, hashing as we write will probably provide better temporal locality to the data being hashed. If the hash computation is cheap, fetching the PDB data from RAM into cache will dominate. It's hard to say whether parallelizing the hash will be more of a win than the locality of doing it in the streaming interface, but given that it's not clearly better, I would lean towards doing this because it's convenient.


https://reviews.llvm.org/D51887





More information about the llvm-commits mailing list