1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Go to file
Teresa Johnson 919474967d [ThinLTO] More efficient export computation (NFC)
Summary:
A recent change to enable more importing of global variables with
references exposed some efficiency issues with export computation.
See D73724 for more information and detailed analysis.

The first was specific to variable importing. The code was marking every
copy of a referenced value (from possibly thousands of files in the case
of linkonce_odr) as exported, and we only need to mark the copy in the
module containing the variable def being imported as exported. The
reason is that this is tracking what values are newly exported as a
result of importing. Anything that was defined in another module and
simply used in the exporting module is already exported, and would have
been identified by the caller (e.g. the LTO API implementations).

The second issue is that the code was re-adding previously exported
values (along with all references). It is easy to identify when a
variable was already imported into the same module (via the
import list insert call return value), and we already did this for
function importing. However, what we weren't doing for either function
or variable importing was avoiding a re-insertion when it was previously
exported into a different importing module. The reason we couldn't do
this is there was no way of telling from the export list whether it was
previously inserted there because its definition was exported (in which
case we already marked all its references as exported) from when it was
inserted there because it was referenced by another exported value (in
which case we haven't yet inserted its own references).

To address this we can restructure the way the export list is
constructed. This patch only adds the actual imported definitions
(variable or function) to the export list for its module during the
import computation. After import computation is complete, where we were
already post-processing the export list we go ahead and add all
references made by those exported values to the export list.

These changes speed up the thin link not only with constant variable
importing enabled, but also without (due to the efficiency improvement
in function importing).

Some thin link user time measurements for one large application, average
of 5 runs:

With constant variable importing enabled:
- without this patch: 479.5s
- with this patch: 74.6s

Without constant variable importing enabled:
- without this patch: 80.6s
- with this patch: 70.3s

Note I have not re-enabled constant variable importing here, as I would
like to do additional compile time measurements with these fixes first.

Reviewers: evgeny777

Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73851
2020-02-03 09:15:33 -08:00
benchmarks Pull google/benchmark library to the LLVM tree 2018-08-28 09:42:41 +00:00
bindings Pass length of string in Go binding of CreateCompileUnit 2020-01-17 13:35:30 -08:00
cmake build: attempt to repair the build 2020-02-02 16:18:00 -08:00
docs [llvm-extract] Add -keep-const-init commandline option 2020-02-03 14:30:28 +09:00
examples Add ThinLtoJIT example 2020-02-01 20:25:09 +01:00
include Actually, don't try to use __builtin_strlen in StringRef.h before VS 2019 2020-02-03 17:49:29 +01:00
lib [ThinLTO] More efficient export computation (NFC) 2020-02-03 09:15:33 -08:00
projects Add few docs and implementation of strcpy and strcat. 2019-10-04 17:30:54 +00:00
resources
runtimes [build] Fix LLVM_ENABLE_RUNTIMES override condition 2020-01-29 13:41:31 -08:00
test [AMDGPU] getMemOperandsWithOffset: add resource operand for BUF instructions 2020-02-03 17:06:09 +00:00
tools [llvm-exegesis] Restrict the range of allowable rounding countrols. 2020-02-03 11:53:27 +01:00
unittests Revert "[OpenMP][OMPIRBuilder] Add Directives (master and critical) to OMPBuilder." 2020-02-03 08:59:14 -06:00
utils build_llvm_package.bat: Use a short form of the git revision 2020-02-03 16:40:10 +01:00
.arcconfig
.clang-format
.clang-tidy - Update .clang-tidy to ignore parameters of main like functions for naming violations in clang and llvm directory 2020-01-31 16:49:45 +00:00
.gitattributes Fix the "git modified" issue on the preserve-comments-crlf.s. 2019-09-10 12:17:49 +00:00
.gitignore [llvm] Fix file ignoring inside directories 2020-01-27 17:00:33 -08:00
CMakeLists.txt Bump the trunk major version to 11 2020-01-15 13:38:01 +01:00
CODE_OWNERS.TXT [VE] Target stub for NEC SX-Aurora 2020-01-09 11:17:35 +01:00
configure
CREDITS.TXT Update email address. 2019-07-17 07:02:02 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
llvm.spec.in Update structured references to the license to the new license. 2019-01-19 11:30:51 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
README.txt Test commit. 2019-10-03 14:57:49 +00:00
RELEASE_TESTERS.TXT Update the list of platforms & archs 2018-12-16 14:47:16 +00:00

The LLVM Compiler Infrastructure
================================

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.