diff options
author | Rui Ueyama <ruiu@google.com> | 2017-04-26 22:45:04 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2017-04-26 22:45:04 +0000 |
commit | 87b30ac9d369ff8b0d553e6d2070a4fa686c67bd (patch) | |
tree | b7229433f0047d5793dc45a7d903bf036d3375e3 /llvm/lib/Support/xxhash.cpp | |
parent | 1b07d689c3180decabb4f267223db4fd1524cf37 (diff) | |
download | bcm5719-llvm-87b30ac9d369ff8b0d553e6d2070a4fa686c67bd.tar.gz bcm5719-llvm-87b30ac9d369ff8b0d553e6d2070a4fa686c67bd.zip |
Replace HashString algorithm with xxHash64
The previous algorithm processed one character at a time, which is very
painful on a modern CPU. Replace it with xxHash64, which both already
exists in the codebase and is fairly fast.
Patch from Scott Smith!
Differential Revision: https://reviews.llvm.org/D32509
llvm-svn: 301487
Diffstat (limited to 'llvm/lib/Support/xxhash.cpp')
-rw-r--r-- | llvm/lib/Support/xxhash.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Support/xxhash.cpp b/llvm/lib/Support/xxhash.cpp index a7d990bf6a4..ca3120df4bc 100644 --- a/llvm/lib/Support/xxhash.cpp +++ b/llvm/lib/Support/xxhash.cpp @@ -68,9 +68,8 @@ static uint64_t mergeRound(uint64_t Acc, uint64_t Val) { return Acc; } -uint64_t llvm::xxHash64(StringRef Data) { +uint64_t llvm::xxHash64(StringRef Data, uint64_t Seed) { size_t Len = Data.size(); - uint64_t Seed = 0; const char *P = Data.data(); const char *const BEnd = P + Len; uint64_t H64; |