[llvm] [ADT] Update hash function of uint64_t for DenseMap (PR #95734)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 12:41:46 PDT 2024


================
@@ -137,7 +137,10 @@ template<> struct DenseMapInfo<unsigned long> {
   static inline unsigned long getTombstoneKey() { return ~0UL - 1L; }
 
   static unsigned getHashValue(const unsigned long& Val) {
-    return (unsigned)(Val * 37UL);
+    if constexpr (sizeof(Val) == 4)
----------------
MaskRay wrote:

Now we have `densemap::detail::mix` with very low latency, we can use it unconditionally for now.

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


More information about the llvm-commits mailing list