From 0c91b93d2bd9e402e6dd405837217fc9c7cf1caf Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Fri, 21 Mar 2025 11:05:14 -0700 Subject: [PATCH] [IRGenModule] Fix hash function for FixedLayoutKey `bitwiseTakable` is not a boolean value and has more than binary value. Don't hash it as bool as it can cause unnecessary hash collision. --- lib/IRGen/IRGenModule.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/IRGen/IRGenModule.h b/lib/IRGen/IRGenModule.h index d356799379e49..660bc8e36a6b5 100644 --- a/lib/IRGen/IRGenModule.h +++ b/lib/IRGen/IRGenModule.h @@ -2078,7 +2078,7 @@ struct DenseMapInfo { static unsigned getHashValue(const FixedLayoutKey &key) { return hash_combine(key.size, key.numExtraInhabitants, key.align, - (bool)key.pod, (bool)key.bitwiseTakable); + (bool)key.pod, key.bitwiseTakable); } static bool isEqual(const FixedLayoutKey &a, const FixedLayoutKey &b) { return a.size == b.size