[lld] r352117 - [PDB] Increase TPI hash bucket count.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 24 14:25:55 PST 2019


Author: zturner
Date: Thu Jan 24 14:25:55 2019
New Revision: 352117

URL: http://llvm.org/viewvc/llvm-project?rev=352117&view=rev
Log:
[PDB] Increase TPI hash bucket count.

PDBs contain several serialized hash tables. In the microsoft-pdb
repo published to support LLVM implementing PDB support, the
provided initializes the bucket count for the TPI and IPI streams
to the maximum size. This occurs in tpi.cpp L33 and tpi.cpp L398.
In the LLVM code for generating PDBs, these streams are created with
minimum number of buckets. This difference makes LLVM generated
PDBs slower for when used for debugging.

Patch by C.J. Hebert
Differential Revision: https://reviews.llvm.org/D56942

Added:
    lld/trunk/test/COFF/pdb-tpi-hash-size.test
Modified:
    lld/trunk/test/COFF/pdb.test

Added: lld/trunk/test/COFF/pdb-tpi-hash-size.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/pdb-tpi-hash-size.test?rev=352117&view=auto
==============================================================================
--- lld/trunk/test/COFF/pdb-tpi-hash-size.test (added)
+++ lld/trunk/test/COFF/pdb-tpi-hash-size.test Thu Jan 24 14:25:55 2019
@@ -0,0 +1,10 @@
+# RUN: yaml2obj < %p/Inputs/pdb1.yaml > %t1.obj
+# RUN: yaml2obj < %p/Inputs/pdb2.yaml > %t2.obj
+# RUN: rm -f %t.dll %t.pdb
+# RUN: lld-link /debug /pdb:%t.pdb /dll /out:%t.dll \
+# RUN:   /entry:main /nodefaultlib %t1.obj %t2.obj
+
+# RUN: llvm-pdbutil dump -types -type-extras %t.pdb | FileCheck %s
+
+CHECK:      Hash Key Size: 4
+CHECK-NEXT: Num Hash Buckets: 262143

Modified: lld/trunk/test/COFF/pdb.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/pdb.test?rev=352117&r1=352116&r2=352117&view=diff
==============================================================================
--- lld/trunk/test/COFF/pdb.test (original)
+++ lld/trunk/test/COFF/pdb.test Thu Jan 24 14:25:55 2019
@@ -142,40 +142,40 @@ RAW-NEXT:              pdb file ni: 1 `{
 RAW:                          Types (TPI Stream)
 RAW-NEXT: ============================================================
 RAW-NEXT:   Showing 5 records
-RAW-NEXT:   0x1000 | LF_ARGLIST [size = 8, hash = 0xEC0]
-RAW-NEXT:   0x1001 | LF_PROCEDURE [size = 16, hash = 0x7BC]
+RAW-NEXT:   0x1000 | LF_ARGLIST [size = 8, hash = 0x32484]
+RAW-NEXT:   0x1001 | LF_PROCEDURE [size = 16, hash = 0x27EE9]
 RAW-NEXT:            return type = 0x0074 (int), # args = 0, param list = 0x1000
 RAW-NEXT:            calling conv = cdecl, options = None
-RAW-NEXT:   0x1002 | LF_POINTER [size = 12, hash = 0x884]
+RAW-NEXT:   0x1002 | LF_POINTER [size = 12, hash = 0x39732]
 RAW-NEXT:            referent = 0x1001, mode = pointer, opts = None, kind = ptr64
-RAW-NEXT:   0x1003 | LF_ARGLIST [size = 12, hash = 0x936]
+RAW-NEXT:   0x1003 | LF_ARGLIST [size = 12, hash = 0x1FC10]
 RAW-NEXT:            <no type>: ``
-RAW-NEXT:   0x1004 | LF_PROCEDURE [size = 16, hash = 0x852]
+RAW-NEXT:   0x1004 | LF_PROCEDURE [size = 16, hash = 0x1BD3]
 RAW-NEXT:            return type = 0x0074 (int), # args = 0, param list = 0x1003
 RAW-NEXT:            calling conv = cdecl, options = None
 RAW:                          Types (IPI Stream)
 RAW-NEXT: ============================================================
 RAW-NEXT:   Showing 12 records
-RAW-NEXT:   0x1000 | LF_FUNC_ID [size = 20, hash = 0x330]
+RAW-NEXT:   0x1000 | LF_FUNC_ID [size = 20, hash = 0x38E5A]
 RAW-NEXT:            name = main, type = 0x1004, parent scope = <no type>
-RAW-NEXT:   0x1001 | LF_FUNC_ID [size = 16, hash = 0x120]
+RAW-NEXT:   0x1001 | LF_FUNC_ID [size = 16, hash = 0xD08E]
 RAW-NEXT:            name = foo, type = 0x1001, parent scope = <no type>
-RAW-NEXT:   0x1002 | LF_STRING_ID [size = 16, hash = 0x757] ID: <no type>, String: D:\b
-RAW-NEXT:   0x1003 | LF_STRING_ID [size = 36, hash = 0xC3A] ID: <no type>, String: C:\vs14\VC\BIN\amd64\cl.exe
-RAW-NEXT:   0x1004 | LF_STRING_ID [size = 260, hash = 0x433] ID: <no type>, String: -Z7 -c -MT -IC:\vs14\VC\INCLUDE -IC:\vs14\VC\ATLMFC\INCLUDE -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\include\shared"
-RAW-NEXT:   0x1005 | LF_SUBSTR_LIST [size = 12, hash = 0x759]
+RAW-NEXT:   0x1002 | LF_STRING_ID [size = 16, hash = 0x3EBD9] ID: <no type>, String: D:\b
+RAW-NEXT:   0x1003 | LF_STRING_ID [size = 36, hash = 0xD327] ID: <no type>, String: C:\vs14\VC\BIN\amd64\cl.exe
+RAW-NEXT:   0x1004 | LF_STRING_ID [size = 260, hash = 0x2FA6A]  ID: <no type>, String: -Z7 -c -MT -IC:\vs14\VC\INCLUDE -IC:\vs14\VC\ATLMFC\INCLUDE -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\include\shared"
+RAW-NEXT:   0x1005 | LF_SUBSTR_LIST [size = 12, hash = 0x6053]
 RAW-NEXT:            0x1004: `-Z7 -c -MT -IC:\vs14\VC\INCLUDE -IC:\vs14\VC\ATLMFC\INCLUDE -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\include\shared"`
-RAW-NEXT:   0x1006 | LF_STRING_ID [size = 132, hash = 0xF57] ID: 0x1005, String:  -I"C:\Program Files (x86)\Windows Kits\8.1\include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\include\winrt" -TC -X
-RAW-NEXT:   0x1007 | LF_STRING_ID [size = 24, hash = 0x2D1] ID: <no type>, String: ret42-main.c
-RAW-NEXT:   0x1008 | LF_STRING_ID [size = 24, hash = 0xB8B] ID: <no type>, String: D:\b\vc140.pdb
-RAW-NEXT:   0x1009 | LF_BUILDINFO [size = 28, hash = 0xA8C]
+RAW-NEXT:   0x1006 | LF_STRING_ID [size = 132, hash = 0xCAC7] ID: 0x1005, String:  -I"C:\Program Files (x86)\Windows Kits\8.1\include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\include\winrt" -TC -X
+RAW-NEXT:   0x1007 | LF_STRING_ID [size = 24, hash = 0x21783] ID: <no type>, String: ret42-main.c
+RAW-NEXT:   0x1008 | LF_STRING_ID [size = 24, hash = 0x1DB87] ID: <no type>, String: D:\b\vc140.pdb
+RAW-NEXT:   0x1009 | LF_BUILDINFO [size = 28, hash = 0x5E91]
 RAW-NEXT:            0x1002: `D:\b`
 RAW-NEXT:            0x1003: `C:\vs14\VC\BIN\amd64\cl.exe`
 RAW-NEXT:            0x1007: `ret42-main.c`
 RAW-NEXT:            0x1008: `D:\b\vc140.pdb`
 RAW-NEXT:            0x1006: ` -I"C:\Program Files (x86)\Windows Kits\8.1\include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\include\winrt" -TC -X`
-RAW-NEXT:   0x100A | LF_STRING_ID [size = 20, hash = 0x39C] ID: <no type>, String: ret42-sub.c
-RAW-NEXT:   0x100B | LF_BUILDINFO [size = 28, hash = 0xAD7]
+RAW-NEXT:   0x100A | LF_STRING_ID [size = 20, hash = 0x7C68] ID: <no type>, String: ret42-sub.c
+RAW-NEXT:   0x100B | LF_BUILDINFO [size = 28, hash = 0x254D2]
 RAW-NEXT:            0x1002: `D:\b`
 RAW-NEXT:            0x1003: `C:\vs14\VC\BIN\amd64\cl.exe`
 RAW-NEXT:            0x100A: `ret42-sub.c`




More information about the llvm-commits mailing list