From 0e1e0ce556810ad5f9d45485e686f0653530516c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 2 Sep 2023 23:17:18 +0200 Subject: Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the last commit before the upstream release/17.x branch was created. PR: 273753 MFC after: 1 month (cherry picked from commit 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e) --- contrib/llvm-project/llvm/lib/Support/StringMap.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'contrib/llvm-project/llvm/lib/Support/StringMap.cpp') diff --git a/contrib/llvm-project/llvm/lib/Support/StringMap.cpp b/contrib/llvm-project/llvm/lib/Support/StringMap.cpp index 9b2f96fca2cd..67c05a87959c 100644 --- a/contrib/llvm-project/llvm/lib/Support/StringMap.cpp +++ b/contrib/llvm-project/llvm/lib/Support/StringMap.cpp @@ -11,8 +11,9 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/StringMap.h" -#include "llvm/Support/DJB.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/ReverseIteration.h" +#include "llvm/Support/xxhash.h" using namespace llvm; @@ -84,7 +85,9 @@ unsigned StringMapImpl::LookupBucketFor(StringRef Name) { // Hash table unallocated so far? if (NumBuckets == 0) init(16); - unsigned FullHashValue = djbHash(Name, 0); + unsigned FullHashValue = xxh3_64bits(Name); + if (shouldReverseIterate()) + FullHashValue = ~FullHashValue; unsigned BucketNo = FullHashValue & (NumBuckets - 1); unsigned *HashTable = getHashTable(TheTable, NumBuckets); @@ -139,7 +142,9 @@ unsigned StringMapImpl::LookupBucketFor(StringRef Name) { int StringMapImpl::FindKey(StringRef Key) const { if (NumBuckets == 0) return -1; // Really empty table? - unsigned FullHashValue = djbHash(Key, 0); + unsigned FullHashValue = xxh3_64bits(Key); + if (shouldReverseIterate()) + FullHashValue = ~FullHashValue; unsigned BucketNo = FullHashValue & (NumBuckets - 1); unsigned *HashTable = getHashTable(TheTable, NumBuckets); -- cgit v1.2.3