1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Go to file
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
bindings [go bindings] Rmove duplicated conversion function definitions after r300843. 2017-04-20 19:06:11 +00:00
cmake CMake: Fix docs-llvm-man target when clang+llvm is in the same source tree 2017-05-15 09:34:23 +00:00
docs Update the documentation and CMake file for Visual Studio generators. 2017-05-25 21:01:30 +00:00
examples [Kaleidoscope] toy.cpp use after move fix 2017-05-07 11:00:01 +00:00
include [CodeView Type Merging] Avoid record deserialization when possible. 2017-05-25 21:06:28 +00:00
lib [CodeView Type Merging] Avoid record deserialization when possible. 2017-05-25 21:06:28 +00:00
projects Add temporary workaround to allow in-tree libc++ builds on Windows 2017-05-11 01:44:30 +00:00
resources
runtimes [CMake][runtimes] Use -nodefaultlibs for the runtimes build 2017-04-13 21:29:03 +00:00
test Revert r303859, CodeGen/AMDGPU/llvm.amdgcn.s.getpc.ll fails on bots. 2017-05-25 19:19:29 +00:00
tools [llvm-pdbdump] [yaml2pdb] always include object file name in module info 2017-05-25 18:04:17 +00:00
unittests Revert "Revert "Attempt to pacify ASan and UBSan reports in CrashRecovery tests"" 2017-05-24 19:11:12 +00:00
utils Fixed nondeterminism in RuleMatcher::emit. 2017-05-25 01:51:53 +00:00
.arcconfig project_id is from another era in phabricator land and does not provide any value. 2016-09-27 15:47:29 +00:00
.clang-format
.clang-tidy .clang-tidy: correct style name is 'camelBack' not 'lowerCase'. 2016-09-13 19:04:26 +00:00
.gitignore gitignore: Ignore .vs folder (VS2017 config files) 2017-04-08 00:16:58 +00:00
CMakeLists.txt Update the documentation and CMake file for Visual Studio generators. 2017-05-25 21:01:30 +00:00
CODE_OWNERS.TXT CODE_OWNERS: Take code ownership of instruction scheduling. 2017-03-10 18:34:37 +00:00
configure Remove autoconf support 2016-01-26 21:29:08 +00:00
CREDITS.TXT update of the url 2017-05-14 07:55:01 +00:00
LICENSE.TXT Bump year to 2017 in LICENSE.txt 2017-01-12 18:02:42 +00:00
llvm.spec.in [Sparc] Implement i64 load/store support for 32-bit sparc. 2015-08-10 19:11:39 +00:00
LLVMBuild.txt
README.txt Test commit. Added a blank line. 2017-03-06 20:45:33 +00:00
RELEASE_TESTERS.TXT Update the release tester for MIPS. NFC. 2017-01-17 11:00:28 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.