summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Native
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2019-01-24 22:25:55 +0000
committerZachary Turner <zturner@google.com>2019-01-24 22:25:55 +0000
commit8371da385a5dd08e0161368bb87b6b8cb3001d6a (patch)
treeba53a8f03e884fa1b50e4c73b48f369ed2cfe334 /llvm/lib/DebugInfo/PDB/Native
parenta228ab524f78bc00336f399782ae6375f9d0e17c (diff)
downloadbcm5719-llvm-8371da385a5dd08e0161368bb87b6b8cb3001d6a.tar.gz
bcm5719-llvm-8371da385a5dd08e0161368bb87b6b8cb3001d6a.zip
[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 llvm-svn: 352117
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
index 36f02e5873f..f2a5dcb93d6 100644
--- a/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
@@ -76,7 +76,7 @@ Error TpiStreamBuilder::finalize() {
H->HashStreamIndex = HashStreamIndex;
H->HashAuxStreamIndex = kInvalidStreamIndex;
H->HashKeySize = sizeof(ulittle32_t);
- H->NumHashBuckets = MinTpiHashBuckets;
+ H->NumHashBuckets = MaxTpiHashBuckets - 1;
// Recall that hash values go into a completely different stream identified by
// the `HashStreamIndex` field of the `TpiStreamHeader`. Therefore, the data
@@ -129,7 +129,7 @@ Error TpiStreamBuilder::finalizeMsfLayout() {
ulittle32_t *H = Allocator.Allocate<ulittle32_t>(TypeHashes.size());
MutableArrayRef<ulittle32_t> HashBuffer(H, TypeHashes.size());
for (uint32_t I = 0; I < TypeHashes.size(); ++I) {
- HashBuffer[I] = TypeHashes[I] % MinTpiHashBuckets;
+ HashBuffer[I] = TypeHashes[I] % (MaxTpiHashBuckets - 1);
}
ArrayRef<uint8_t> Bytes(
reinterpret_cast<const uint8_t *>(HashBuffer.data()),
OpenPOWER on IntegriCloud