[llvm] [Hashing] Replace CityHash mixers with xxh3 (PR #194567)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Sat May 9 11:47:21 PDT 2026


================
@@ -38,19 +38,18 @@
 #ifndef LLVM_SUPPORT_XXHASH_H
 #define LLVM_SUPPORT_XXHASH_H
 
-#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Compiler.h"
+#include <cstddef>
+#include <cstdint>
 
 namespace llvm {
 
-LLVM_ABI uint64_t xxHash64(llvm::StringRef Data);
-LLVM_ABI uint64_t xxHash64(llvm::ArrayRef<uint8_t> Data);
+// Deprecated pre-xxh3 64-bit hash.
+LLVM_ABI uint64_t xxHash64(const uint8_t *data, size_t len);
 
-LLVM_ABI uint64_t xxh3_64bits(ArrayRef<uint8_t> data);
-inline uint64_t xxh3_64bits(StringRef data) {
-  return xxh3_64bits(ArrayRef(data.bytes_begin(), data.size()));
-}
+/// XXH3's 64-bit variant. Inline ArrayRef and StringRef overloads live in
----------------
kuhar wrote:

I think `llvm/benchmarks/xxhash.cpp` should now include `llvm/ADT/ArrayRef.h` explicitly. With the new `xxhash.h` includes, a no-PCH syntax-only compile of that file would fail because `llvm::ArrayRef` is no longer declared.

https://github.com/llvm/llvm-project/pull/194567


More information about the llvm-commits mailing list