PDBFileBuilder: Switch to xxh3_64bits
authorFangrui Song <i@maskray.me>
Wed, 19 Jul 2023 22:31:51 +0000 (15:31 -0700)
committerFangrui Song <i@maskray.me>
Wed, 19 Jul 2023 22:31:51 +0000 (15:31 -0700)
Following recent changes switching from xxh64 to xxh32 for better
hashing performance (e.g., D154813). I am not familiar with this use
case, but this change will ensure that the lld executable doesn't need
xxHash64 after wasm-ld migrates.

llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp

index 169d49f..b17fbd6 100644 (file)
@@ -76,7 +76,7 @@ struct llvm::pdb::SymbolDenseMapInfo {
     return Tombstone;
   }
   static unsigned getHashValue(const CVSymbol &Val) {
-    return xxHash64(Val.RecordData);
+    return xxh3_64bits(Val.RecordData);
   }
   static bool isEqual(const CVSymbol &LHS, const CVSymbol &RHS) {
     return LHS.RecordData == RHS.RecordData;
index 3ed2808..cd30b56 100644 (file)
@@ -340,7 +340,7 @@ Error PDBFileBuilder::commit(StringRef Filename, codeview::GUID *Guid) {
   if (Info->hashPDBContentsToGUID()) {
     // Compute a hash of all sections of the output file.
     uint64_t Digest =
-        xxHash64({Buffer.getBufferStart(), Buffer.getBufferEnd()});
+        xxh3_64bits({Buffer.getBufferStart(), Buffer.getBufferEnd()});
 
     H->Age = 1;