[PATCH] D155781: [Support] Change StringMap hash function from xxHash64 to xxh3_64bits

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 22:00:25 PDT 2023


MaskRay updated this revision to Diff 543147.
MaskRay added a comment.

rebase


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155781/new/

https://reviews.llvm.org/D155781

Files:
  llvm/lib/Support/StringMap.cpp


Index: llvm/lib/Support/StringMap.cpp
===================================================================
--- llvm/lib/Support/StringMap.cpp
+++ llvm/lib/Support/StringMap.cpp
@@ -85,7 +85,7 @@
   // Hash table unallocated so far?
   if (NumBuckets == 0)
     init(16);
-  unsigned FullHashValue = xxHash64(Name);
+  unsigned FullHashValue = xxh3_64bits(Name);
   if (shouldReverseIterate())
     FullHashValue = ~FullHashValue;
   unsigned BucketNo = FullHashValue & (NumBuckets - 1);
@@ -142,7 +142,7 @@
 int StringMapImpl::FindKey(StringRef Key) const {
   if (NumBuckets == 0)
     return -1; // Really empty table?
-  unsigned FullHashValue = xxHash64(Key);
+  unsigned FullHashValue = xxh3_64bits(Key);
   if (shouldReverseIterate())
     FullHashValue = ~FullHashValue;
   unsigned BucketNo = FullHashValue & (NumBuckets - 1);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155781.543147.patch
Type: text/x-patch
Size: 834 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230722/316e65bf/attachment.bin>


More information about the llvm-commits mailing list