[llvm] 52eab34 - PDBFileBuilder: Switch to xxh3_64bits

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 15:31:56 PDT 2023


Author: Fangrui Song
Date: 2023-07-19T15:31:51-07:00
New Revision: 52eab3430a3ad3d04505df7b2131552865305109

URL: https://github.com/llvm/llvm-project/commit/52eab3430a3ad3d04505df7b2131552865305109
DIFF: https://github.com/llvm/llvm-project/commit/52eab3430a3ad3d04505df7b2131552865305109.diff

LOG: 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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
index 169d49f64eb5c0..b17fbd63e9fd4d 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 3ed2808bc304eb..cd30b56be7cd85 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;
 


        


More information about the llvm-commits mailing list