1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/lib/DebugInfo/PDB/Native
Zachary Turner d610ac22c2 [CodeView Type Merging] Avoid record deserialization when possible.
A profile shows the majority of time doing type merging is spent
deserializing records from sequences of bytes into friendly C++ structures
that we can easily access members of in order to find the type indices to
re-write.

Records are prefixed with their length, however, and most records have
type indices that appear at fixed offsets in the record. For these
records, we can save some cycles by just looking at the right place in the
byte sequence and re-writing the value, then skipping the record in the
type stream. This saves us from the costly deserialization of examining
every field, including potentially null terminated strings which are the
slowest, even though it was unnecessary to begin with.

In addition, we apply another optimization. Previously, after
deserializing a record and re-writing its type indices, we would
unconditionally re-serialize it in order to compute the hash of the
re-written record. This would result in an alloc and memcpy for every
record. If no type indices were re-written, however, this was an
unnecessary allocation. In this patch re-writing is made two phase. The
first phase discovers the indices that need to be rewritten and their new
values. This information is passed through to the de-duplication code,
which only copies and re-writes type indices in the serialized byte
sequence if at least one type index is different.

Some records have type indices which only appear after variable length
strings, or which have lists of type indices, or various other situations
that can make it tricky to make this optimization. While I'm not giving up
on optimizing these cases as well, for now we can get the easy cases out
of the way and lay the groundwork for more complicated cases later.

This patch yields another 50% speedup on top of the already large speedups
submitted over the past 2 days. In two tests I have run, I went from 9
seconds to 3 seconds, and from 16 seconds to 8 seconds.

Differential Revision: https://reviews.llvm.org/D33480

llvm-svn: 303914
2017-05-25 21:06:28 +00:00
..
DbiModuleDescriptor.cpp [llvm-pdbdump] Abstract some of the YAML/Raw printing code. 2017-04-29 01:13:21 +00:00
DbiModuleDescriptorBuilder.cpp Fix use after free in BinaryStream library. 2017-05-03 05:34:00 +00:00
DbiModuleList.cpp [PDB] Don't build the entire source file list up front. 2017-05-04 23:53:29 +00:00
DbiStream.cpp Fix some minor issues in PDB parsing library. 2017-05-18 15:14:44 +00:00
DbiStreamBuilder.cpp [CodeView] Write CodeView line information. 2017-05-01 23:27:42 +00:00
EnumTables.cpp
GlobalsStream.cpp [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
GSI.cpp [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
GSI.h [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
Hash.cpp
HashTable.cpp [PDB] Make streams carry their own endianness. 2017-02-28 00:04:07 +00:00
InfoStream.cpp Silence -Wcovered-switch-default warning. 2017-03-16 20:45:11 +00:00
InfoStreamBuilder.cpp [PDB] Add support for parsing Flags from PDB Stream. 2017-03-16 20:19:11 +00:00
ModuleDebugStream.cpp [PDB/CodeView] Rename some classes. 2017-05-01 16:46:39 +00:00
ModuleDebugStreamBuilder.cpp [CodeView] Write CodeView line information. 2017-05-01 23:27:42 +00:00
NamedStreamMap.cpp [llvm-pdbdump] Add support for diffing the PDB Stream. 2017-03-16 20:18:41 +00:00
NativeCompilandSymbol.cpp [PDB] Don't build the entire source file list up front. 2017-05-04 23:53:29 +00:00
NativeEnumModules.cpp [PDB] Don't build the entire source file list up front. 2017-05-04 23:53:29 +00:00
NativeExeSymbol.cpp [PDB] Don't build the entire source file list up front. 2017-05-04 23:53:29 +00:00
NativeRawSymbol.cpp [llvm-pdbdump] Re-write the record layout code to be more resilient. 2017-04-24 17:47:24 +00:00
NativeSession.cpp [llvm-pdbdump] More advanced class definition dumping. 2017-04-12 23:18:21 +00:00
PDBFile.cpp Resubmit r301986 and r301987 "Add codeview::StringTable" 2017-05-03 15:58:37 +00:00
PDBFileBuilder.cpp [llvm-pdbdump] in yaml2pdb, generate default output filename if none given 2017-05-17 20:46:48 +00:00
PDBStringTable.cpp [llvm-readobj] Update readobj to re-use parsing code. 2017-05-03 17:11:11 +00:00
PDBStringTableBuilder.cpp Resubmit r301986 and r301987 "Add codeview::StringTable" 2017-05-03 15:58:37 +00:00
PDBTypeServerHandler.cpp [CodeView Type Merging] Avoid record deserialization when possible. 2017-05-25 21:06:28 +00:00
PublicsStream.cpp [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
RawError.cpp [pdb] Write the module info and symbol record streams. 2017-03-15 22:18:53 +00:00
SymbolStream.cpp [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
TpiHashing.cpp
TpiStream.cpp Implement various flavors of type merging. 2017-05-22 21:07:43 +00:00
TpiStreamBuilder.cpp [llvm-pdbdump] Add the ability to merge PDBs. 2017-05-18 23:03:41 +00:00