llvm.org GIT mirror llvm / 24fa368
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352117 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 6 months ago
2 changed file(s) with 17 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
7575 H->HashStreamIndex = HashStreamIndex;
7676 H->HashAuxStreamIndex = kInvalidStreamIndex;
7777 H->HashKeySize = sizeof(ulittle32_t);
78 H->NumHashBuckets = MinTpiHashBuckets;
78 H->NumHashBuckets = MaxTpiHashBuckets - 1;
7979
8080 // Recall that hash values go into a completely different stream identified by
8181 // the `HashStreamIndex` field of the `TpiStreamHeader`. Therefore, the data
128128 ulittle32_t *H = Allocator.Allocate(TypeHashes.size());
129129 MutableArrayRef HashBuffer(H, TypeHashes.size());
130130 for (uint32_t I = 0; I < TypeHashes.size(); ++I) {
131 HashBuffer[I] = TypeHashes[I] % MinTpiHashBuckets;
131 HashBuffer[I] = TypeHashes[I] % (MaxTpiHashBuckets - 1);
132132 }
133133 ArrayRef Bytes(
134134 reinterpret_cast(HashBuffer.data()),
14111411
14121412 if (DumpExtras) {
14131413 P.NewLine();
1414 support::ulittle32_t Version;
1415
1416 support::ulittle16_t HashStreamIndex;
1417 support::ulittle16_t HashAuxStreamIndex;
1418 support::ulittle32_t HashKeySize;
1419 support::ulittle32_t NumHashBuckets;
1420
1421 P.formatLine("Header Version: {0}",
1422 static_cast(Stream.getTpiVersion()));
1423 P.formatLine("Hash Stream Index: {0}", Stream.getTypeHashStreamIndex());
1424 P.formatLine("Aux Hash Stream Index: {0}",
1425 Stream.getTypeHashStreamAuxIndex());
1426 P.formatLine("Hash Key Size: {0}", Stream.getHashKeySize());
1427 P.formatLine("Num Hash Buckets: {0}", Stream.getNumHashBuckets());
1428
14141429 auto IndexOffsets = Stream.getTypeIndexOffsets();
14151430 P.formatLine("Type Index Offsets:");
14161431 for (const auto &IO : IndexOffsets) {