1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

Revert "Use the default seed value for djb hash for StringMap"

This reverts commit d84440ec919019ac446241db72cfd905c6ac9dfa.

It breaks (at least) lldb and lld validation

https://lab.llvm.org/buildbot/#/builders/68/builds/7837
https://lab.llvm.org/buildbot/#/builders/36/builds/5495
This commit is contained in:
serge-sans-paille 2021-03-01 13:58:18 +01:00
parent 042f6e8e77
commit 66ad213da3
8 changed files with 14 additions and 24 deletions

View File

@ -77,7 +77,7 @@ unsigned StringMapImpl::LookupBucketFor(StringRef Name) {
init(16); init(16);
HTSize = NumBuckets; HTSize = NumBuckets;
} }
unsigned FullHashValue = djbHash(Name); unsigned FullHashValue = djbHash(Name, 0);
unsigned BucketNo = FullHashValue & (HTSize - 1); unsigned BucketNo = FullHashValue & (HTSize - 1);
unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1); unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1);
@ -133,7 +133,7 @@ int StringMapImpl::FindKey(StringRef Key) const {
unsigned HTSize = NumBuckets; unsigned HTSize = NumBuckets;
if (HTSize == 0) if (HTSize == 0)
return -1; // Really empty table? return -1; // Really empty table?
unsigned FullHashValue = djbHash(Key); unsigned FullHashValue = djbHash(Key, 0);
unsigned BucketNo = FullHashValue & (HTSize - 1); unsigned BucketNo = FullHashValue & (HTSize - 1);
unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1); unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1);

View File

@ -27,20 +27,20 @@
; Check that all the names are present in the output ; Check that all the names are present in the output
; CHECK: Hash 0x597841 ; CHECK: Hash 0x597841
; CHECK: String: 0x{{[0-9a-f]*}} "k1"
; CHECK: String: 0x{{[0-9a-f]*}} "is" ; CHECK: String: 0x{{[0-9a-f]*}} "is"
; CHECK: String: 0x{{[0-9a-f]*}} "k1"
; CHECK: Hash 0xa4b42a1e ; CHECK: Hash 0xa4b42a1e
; CHECK: String: 0x{{[0-9a-f]*}} "_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv"
; CHECK: String: 0x{{[0-9a-f]*}} "_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE" ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN5clang23DataRecursiveASTVisitorIN12_GLOBAL__N_124UnusedBackingIvarCheckerEE26TraverseCUDAKernelCallExprEPNS_18CUDAKernelCallExprE"
; CHECK: String: 0x{{[0-9a-f]*}} "_ZN4llvm16DenseMapIteratorIPNS_10MDLocationENS_6detail13DenseSetEmptyENS_10MDNodeInfoIS1_EENS3_12DenseSetPairIS2_EELb0EE23AdvancePastEmptyBucketsEv"
; CHECK: Hash 0xeee7c0b2 ; CHECK: Hash 0xeee7c0b2
; CHECK: String: 0x{{[0-9a-f]*}} "_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE" ; CHECK: String: 0x{{[0-9a-f]*}} "_ZNK4llvm12LivePhysRegs5printERNS_11raw_ostreamE"
; CHECK: String: 0x{{[0-9a-f]*}} "_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE" ; CHECK: String: 0x{{[0-9a-f]*}} "_ZN4llvm15ScalarEvolution14getSignedRangeEPKNS_4SCEVE"
; CHECK: Hash 0xea48ac5f ; CHECK: Hash 0xea48ac5f
; CHECK: String: 0x{{[0-9a-f]*}} "_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_"
; CHECK: String: 0x{{[0-9a-f]*}} "ForceTopDown" ; CHECK: String: 0x{{[0-9a-f]*}} "ForceTopDown"
; CHECK: String: 0x{{[0-9a-f]*}} "_ZNSt3__116allocator_traitsINS_9allocatorINS_11__tree_nodeINS_12__value_typeIPN4llvm10BasicBlockEPNS4_10RegionNodeEEEPvEEEEE11__constructIS9_JNS_4pairIS6_S8_EEEEEvNS_17integral_constantIbLb1EEERSC_PT_DpOT0_"
; CHECK: Hash 0x6b22f71f ; CHECK: Hash 0x6b22f71f
; CHECK: String: 0x{{[0-9a-f]*}} "_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE" ; CHECK: String: 0x{{[0-9a-f]*}} "_ZNK5clang12OverrideAttr5cloneERNS_10ASTContextE"

View File

@ -44,9 +44,9 @@
; CHECK: Hash: 0x2841B989 ; CHECK: Hash: 0x2841B989
; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZL11NumCommutes" ; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZL11NumCommutes"
; CHECK: Hash: 0x3E190F5F ; CHECK: Hash: 0x3E190F5F
; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZL9NumReMats"
; CHECK: Hash: 0x3E190F5F
; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZL9NumRemats" ; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZL9NumRemats"
; CHECK: Hash: 0x3E190F5F
; CHECK-NEXT:String: 0x{{[0-9a-f]*}} "_ZL9NumReMats"
; CHECK-NOT: String: ; CHECK-NOT: String:
; CHECK: Bucket 3 ; CHECK: Bucket 3
; CHECK: Hash: 0x2642207F ; CHECK: Hash: 0x2642207F

View File

@ -19,8 +19,8 @@
; CHECK: .debug_pubtypes contents: ; CHECK: .debug_pubtypes contents:
; CHECK-NEXT: length = 0x0000000000000032, format = DWARF64, version = 0x0002, unit_offset = ; CHECK-NEXT: length = 0x0000000000000032, format = DWARF64, version = 0x0002, unit_offset =
; CHECK-NEXT: Offset Name ; CHECK-NEXT: Offset Name
; CHECK-NEXT: 0x00000000[[BASET]] "int"
; CHECK-NEXT: 0x00000000[[STRUCT]] "Foo" ; CHECK-NEXT: 0x00000000[[STRUCT]] "Foo"
; CHECK-NEXT: 0x00000000[[BASET]] "int"
; IR generated and reduced from: ; IR generated and reduced from:
; $ cat foo.c ; $ cat foo.c

View File

@ -66,14 +66,10 @@
; ASM: .section .debug_gnu_pubnames ; ASM: .section .debug_gnu_pubnames
; ASM: .byte 32 # Attributes: VARIABLE, EXTERNAL ; ASM: .byte 32 # Attributes: VARIABLE, EXTERNAL
; ASM-NEXT: .asciz "C::static_member_variable" # External Name
; ASM: .byte 32 # Attributes: VARIABLE, EXTERNAL
; ASM-NEXT: .asciz "global_variable" # External Name ; ASM-NEXT: .asciz "global_variable" # External Name
; ASM: .section .debug_gnu_pubtypes ; ASM: .section .debug_gnu_pubtypes
; ASM: .byte 16 # Attributes: TYPE, EXTERNAL ; ASM: .byte 16 # Attributes: TYPE, EXTERNAL
; ASM-NEXT: .asciz "named_enum_class" # External Name
; ASM: .byte 16 # Attributes: TYPE, EXTERNAL
; ASM-NEXT: .asciz "C" # External Name ; ASM-NEXT: .asciz "C" # External Name
; CHECK: .debug_info contents: ; CHECK: .debug_info contents:
@ -245,11 +241,6 @@
; CHECK-LABEL: .debug_gnu_pubnames contents: ; CHECK-LABEL: .debug_gnu_pubnames contents:
; CHECK-NEXT: length = {{.*}}, version = 0x0002, unit_offset = 0x00000000, unit_size = {{.*}} ; CHECK-NEXT: length = {{.*}}, version = 0x0002, unit_offset = 0x00000000, unit_size = {{.*}}
; CHECK-NEXT: Offset Linkage Kind Name ; CHECK-NEXT: Offset Linkage Kind Name
; CHECK-NEXT: [[STATIC_MEM_VAR]] EXTERNAL VARIABLE "C::static_member_variable"
; CHECK-NEXT: [[STATIC_MEM_FUNC]] EXTERNAL FUNCTION "C::static_member_function"
; CHECK-NEXT: [[UNNAMED_ENUM_ENUMERATOR]] STATIC VARIABLE "unnamed_enum_enumerator"
; CHECK-NEXT: EXTERNAL FUNCTION "f7"
; CHECK-NEXT: EXTERNAL FUNCTION "f3"
; CHECK-NEXT: [[GLOBAL_FUNC]] EXTERNAL FUNCTION "global_function" ; CHECK-NEXT: [[GLOBAL_FUNC]] EXTERNAL FUNCTION "global_function"
; CHECK-NEXT: [[NS]] EXTERNAL TYPE "ns" ; CHECK-NEXT: [[NS]] EXTERNAL TYPE "ns"
; CHECK-NEXT: [[OUTER_ANON_C]] STATIC VARIABLE "outer::(anonymous namespace)::c" ; CHECK-NEXT: [[OUTER_ANON_C]] STATIC VARIABLE "outer::(anonymous namespace)::c"
@ -268,19 +259,22 @@
; CHECK-NEXT: [[NAMED_ENUM_CLASS_ENUMERATOR]] STATIC VARIABLE "named_enum_class_enumerator" ; CHECK-NEXT: [[NAMED_ENUM_CLASS_ENUMERATOR]] STATIC VARIABLE "named_enum_class_enumerator"
; CHECK-NEXT: [[MEM_FUNC]] EXTERNAL FUNCTION "C::member_function" ; CHECK-NEXT: [[MEM_FUNC]] EXTERNAL FUNCTION "C::member_function"
; CHECK-NEXT: [[GLOB_VAR]] EXTERNAL VARIABLE "global_variable" ; CHECK-NEXT: [[GLOB_VAR]] EXTERNAL VARIABLE "global_variable"
; CHECK-NEXT: [[ANON_INNER]] EXTERNAL TYPE "(anonymous namespace)::inner"
; CHECK-NEXT: [[GLOB_NS_VAR]] EXTERNAL VARIABLE "ns::global_namespace_variable" ; CHECK-NEXT: [[GLOB_NS_VAR]] EXTERNAL VARIABLE "ns::global_namespace_variable"
; CHECK-NEXT: [[ANON_INNER]] EXTERNAL TYPE "(anonymous namespace)::inner"
; CHECK-NEXT: [[D_VAR]] EXTERNAL VARIABLE "ns::d" ; CHECK-NEXT: [[D_VAR]] EXTERNAL VARIABLE "ns::d"
; CHECK-NEXT: [[NAMED_ENUM_ENUMERATOR]] STATIC VARIABLE "named_enum_enumerator" ; CHECK-NEXT: [[NAMED_ENUM_ENUMERATOR]] STATIC VARIABLE "named_enum_enumerator"
; CHECK-NEXT: [[STATIC_MEM_VAR]] EXTERNAL VARIABLE "C::static_member_variable"
; CHECK-NEXT: [[STATIC_MEM_FUNC]] EXTERNAL FUNCTION "C::static_member_function"
; CHECK-NEXT: [[UNNAMED_ENUM_ENUMERATOR]] STATIC VARIABLE "unnamed_enum_enumerator"
; CHECK-LABEL: debug_gnu_pubtypes contents: ; CHECK-LABEL: debug_gnu_pubtypes contents:
; CHECK: Offset Linkage Kind Name ; CHECK: Offset Linkage Kind Name
; CHECK-NEXT: [[INT]] STATIC TYPE "int"
; CHECK-NEXT: [[NAMED_ENUM_CLASS]] EXTERNAL TYPE "named_enum_class"
; CHECK-NEXT: [[C]] EXTERNAL TYPE "C" ; CHECK-NEXT: [[C]] EXTERNAL TYPE "C"
; CHECK-NEXT: [[UNSIGNED_INT]] STATIC TYPE "unsigned int" ; CHECK-NEXT: [[UNSIGNED_INT]] STATIC TYPE "unsigned int"
; CHECK-NEXT: [[D]] EXTERNAL TYPE "ns::D" ; CHECK-NEXT: [[D]] EXTERNAL TYPE "ns::D"
; CHECK-NEXT: [[NAMED_ENUM]] EXTERNAL TYPE "named_enum" ; CHECK-NEXT: [[NAMED_ENUM]] EXTERNAL TYPE "named_enum"
; CHECK-NEXT: [[INT]] STATIC TYPE "int"
; CHECK-NEXT: [[NAMED_ENUM_CLASS]] EXTERNAL TYPE "named_enum_class"
%struct.C = type { i8 } %struct.C = type { i8 }
%"struct.ns::D" = type { i32 } %"struct.ns::D" = type { i32 }

View File

@ -15,7 +15,6 @@
# CHECK-NEXT:.debug_type 26 (2.48%) # CHECK-NEXT:.debug_type 26 (2.48%)
# CHECK-NEXT:.debug_foo 100 (9.54%) # CHECK-NEXT:.debug_foo 100 (9.54%)
# CHECK-NEXT:.debug_info.dwo 9 (0.86%) # CHECK-NEXT:.debug_info.dwo 9 (0.86%)
#
# CHECK-EMPTY: # CHECK-EMPTY:
# CHECK-NEXT: Total Size: 172 (16.41%) # CHECK-NEXT: Total Size: 172 (16.41%)
# CHECK-NEXT: Total File Size: 1048 # CHECK-NEXT: Total File Size: 1048

View File

@ -17,7 +17,6 @@
# CHECK-NEXT:__apple_namespac 36 (1.92%) # CHECK-NEXT:__apple_namespac 36 (1.92%)
# CHECK-NEXT:__apple_types 71 (3.79%) # CHECK-NEXT:__apple_types 71 (3.79%)
# CHECK-NEXT:__debug_line 61 (3.26%) # CHECK-NEXT:__debug_line 61 (3.26%)
# CHECK-EMPTY: # CHECK-EMPTY:
# CHECK-NEXT: Total Size: 588 (31.41%) # CHECK-NEXT: Total Size: 588 (31.41%)
# CHECK-NEXT: Total File Size: 1872 # CHECK-NEXT: Total File Size: 1872

View File

@ -64,8 +64,6 @@
; CHECK-NEXT: "#bytes in __apple_types": 133, ; CHECK-NEXT: "#bytes in __apple_types": 133,
; CHECK-NEXT: "#bytes in __debug_line": 126, ; CHECK-NEXT: "#bytes in __debug_line": 126,
; ModuleID = '/tmp/quality.cpp' ; ModuleID = '/tmp/quality.cpp'
source_filename = "/tmp/quality.cpp" source_filename = "/tmp/quality.cpp"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"