llvm-project/llvm
Teresa Johnson 5f312ad450 [ThinLTO] Consolidate cache key computation between new/old LTO APIs
Summary:
The old legacy LTO API had a separate cache key computation, which was
a subset of the cache key computation in the new LTO API (from what I
can tell this is largely just because certain features such as CFI,
dsoLocal, etc are only utilized via the new LTO API). However, having
separate computations is unnecessary (much of the code is duplicated),
and can lead to bugs when adding new optimizations if both cache
computation algorithms aren't updated properly - it's much easier to
maintain if we have a single facility.

This patch refactors the old LTO API code to use the cache key
computation from the new LTO API. To do this, we set up an lto::Config
object and fill in the fields that the old LTO was hashing (the others
will just use the defaults).

There are two notable changes:
- I added a Freestanding flag to the LTO Config. Currently this is only
used by the legacy LTO API. In the patch that added it (D30791) I had
asked about adding it to the new LTO API, but it looks like that was not
addressed. This should probably be discussed as a follow up to this
change, as it is orthogonal.
- The legacy LTO API had some code that was hashing the GUID of all
preserved symbols defined in the module. I looked back at the history of
this (which was added with the original hashing in the legacy LTO API in
D18494), and there is a comment in the review thread that it was added
in preparation for future internalization. We now do the internalization
of course, and that is handled in the new LTO API cache key computation
by hashing the recorded linkage type of all defined globals. Therefore I
didn't try to move over and keep the preserved symbols handling.

Reviewers: steven_wu, pcc

Subscribers: mehdi_amini, inglorion, eraman, dexonsmith, dang, llvm-commits

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

llvm-svn: 347592
2018-11-26 20:40:37 +00:00
..
benchmarks
bindings [bindings/go] Add Go bindings to LLVMGetIndices 2018-11-08 04:04:04 +00:00
cmake [Support/FileSystem] Add sub-second precision for atime/mtime of sys::fs::file_status on unix platforms 2018-11-26 00:03:39 +00:00
docs Revert "[clang][slh] add attribute for speculative load hardening" 2018-11-26 20:11:18 +00:00
examples Fix build break from r347239 2018-11-19 18:51:11 +00:00
include [ThinLTO] Consolidate cache key computation between new/old LTO APIs 2018-11-26 20:40:37 +00:00
lib [ThinLTO] Consolidate cache key computation between new/old LTO APIs 2018-11-26 20:40:37 +00:00
projects
resources
runtimes
test [SelectionDAG] Teach BaseIndexOffset::match to unwrap the base after looking through an add/or 2018-11-26 20:16:33 +00:00
tools [llvm-mca] Add support for instructions with a variadic number of operands. 2018-11-25 12:46:24 +00:00
unittests [ARM GlobalISel] Support G_CTLZ and G_CTLZ_ZERO_UNDEF 2018-11-26 11:07:02 +00:00
utils [TableGen] Emit more variant transitions 2018-11-23 21:17:33 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore [git/svn] Ignore Visual Studio's CMakeSettings.json. 2018-10-29 14:51:02 +00:00
CMakeLists.txt [LLVM] Allow modulemap installation 2018-11-21 20:46:50 +00:00
CODE_OWNERS.TXT
CREDITS.TXT add Kang Zhang(shkzhang@cn.ibm.com) to the CREDITS.TXT 2018-11-25 02:56:49 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT Adding Yvan as release test backup for Diana 2018-11-08 11:51:27 +00:00
configure
llvm.spec.in

README.txt

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.