[llvm] 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
Modified:
llvm/trunk/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp
Modified: llvm/trunk/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp?rev=352117&r1=352116&r2=352117&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp Thu Jan 24 14:25:55 2019
@@ -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::finalizeMsfLayou
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()),
Modified: llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp?rev=352117&r1=352116&r2=352117&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp (original)
+++ llvm/trunk/tools/llvm-pdbutil/DumpOutputStyle.cpp Thu Jan 24 14:25:55 2019
@@ -1412,6 +1412,21 @@ Error DumpOutputStyle::dumpTpiStream(uin
if (DumpExtras) {
P.NewLine();
+ support::ulittle32_t Version;
+
+ support::ulittle16_t HashStreamIndex;
+ support::ulittle16_t HashAuxStreamIndex;
+ support::ulittle32_t HashKeySize;
+ support::ulittle32_t NumHashBuckets;
+
+ P.formatLine("Header Version: {0}",
+ static_cast<uint32_t>(Stream.getTpiVersion()));
+ P.formatLine("Hash Stream Index: {0}", Stream.getTypeHashStreamIndex());
+ P.formatLine("Aux Hash Stream Index: {0}",
+ Stream.getTypeHashStreamAuxIndex());
+ P.formatLine("Hash Key Size: {0}", Stream.getHashKeySize());
+ P.formatLine("Num Hash Buckets: {0}", Stream.getNumHashBuckets());
+
auto IndexOffsets = Stream.getTypeIndexOffsets();
P.formatLine("Type Index Offsets:");
for (const auto &IO : IndexOffsets) {
More information about the llvm-commits
mailing list