From 52eab3430a3ad3d04505df7b2131552865305109 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 19 Jul 2023 15:31:51 -0700 Subject: [PATCH] PDBFileBuilder: Switch to xxh3_64bits 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 | 2 +- llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp index 169d49f64eb5c..b17fbd63e9fd4 100644 --- a/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp @@ -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; diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp index 3ed2808bc304e..cd30b56be7cd8 100644 --- a/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp @@ -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;