From 84c4061b34e048f47e5eb4fbabc1558495e8157c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 2 Aug 2018 17:33:42 +0000 Subject: Vendor import of lld trunk r338536: https://llvm.org/svn/llvm-project/lld/trunk@338536 --- COFF/ICF.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'COFF') diff --git a/COFF/ICF.cpp b/COFF/ICF.cpp index 629720901ab84..7feb3c4e0b0c5 100644 --- a/COFF/ICF.cpp +++ b/COFF/ICF.cpp @@ -27,6 +27,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/Parallel.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/xxhash.h" #include #include #include @@ -65,13 +66,6 @@ private: std::atomic Repeat = {false}; }; -// Returns a hash value for S. -uint32_t ICF::getHash(SectionChunk *C) { - return hash_combine(C->getOutputCharacteristics(), C->SectionName, - C->Relocs.size(), uint32_t(C->Header->SizeOfRawData), - C->Checksum, C->getContents()); -} - // Returns true if section S is subject of ICF. // // Microsoft's documentation @@ -265,7 +259,7 @@ void ICF::run(ArrayRef Vec) { // Initially, we use hash values to partition sections. for_each(parallel::par, Chunks.begin(), Chunks.end(), [&](SectionChunk *SC) { // Set MSB to 1 to avoid collisions with non-hash classs. - SC->Class[0] = getHash(SC) | (1 << 31); + SC->Class[0] = xxHash64(SC->getContents()) | (1 << 31); }); // From now on, sections in Chunks are ordered so that sections in -- cgit v1.2.3