1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
Go to file
Reid Kleckner f30ad55559 [PGO] Use linkonce_odr linkage for __profd_ variables in comdat groups
This fixes relocations against __profd_ symbols in discarded sections,
which is PR41380.

In general, instrumentation happens very early, and optimization and
inlining happens afterwards. The counters for a function are calculated
early, and after inlining, counters for an inlined function may be
widely referenced by other functions.

For C++ inline functions of all kinds (linkonce_odr &
available_externally mainly), instr profiling wants to deduplicate these
__profc_ and __profd_ globals. Otherwise the binary would be quite
large.

I made __profd_ and __profc_ comdat in r355044, but I chose to make
__profd_ internal. At the time, I was only dealing with coverage, and in
that case, none of the instrumentation needs to reference __profd_.
However, if you use PGO, then instrumentation passes add calls to
__llvm_profile_instrument_range which reference __profd_ globals. The
solution is to make these globals externally visible by using
linkonce_odr linkage for data as was done for counters.

This is safe because PGO adds a CFG hash to the names of the data and
counter globals, so if different TUs have different globals, they will
get different data and counter arrays.

Reviewers: xur, hans

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

llvm-svn: 372020
2019-09-16 18:49:09 +00:00
benchmarks
bindings Bump llvm-go to C++14 2019-08-15 10:55:25 +00:00
cmake [CMake] Don't pass all LLVM_COMPILE_FLAGS to the C compiler 2019-09-10 14:19:52 +00:00
docs [docs][llvm-strings] Write llvm-strings documentation 2019-09-16 13:56:12 +00:00
examples [Orc] Roll back ThreadPool to std::function 2019-09-13 11:59:51 +00:00
include [NFC] remove unused functions 2019-09-16 14:48:58 +00:00
lib [PGO] Use linkonce_odr linkage for __profd_ variables in comdat groups 2019-09-16 18:49:09 +00:00
projects [libc++] Take 2: Integrate the PSTL into libc++ 2019-08-05 18:29:14 +00:00
resources
runtimes Revert "Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds." 2019-09-11 00:43:35 +00:00
test [PGO] Use linkonce_odr linkage for __profd_ variables in comdat groups 2019-09-16 18:49:09 +00:00
tools Added return statement to fix compile and build warning: 2019-09-16 10:30:37 +00:00
unittests [Remarks][NFC] Forward declare ParsedStringTable 2019-09-13 17:27:28 +00:00
utils gn build: Merge r371976 2019-09-16 11:33:54 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes Fix the "git modified" issue on the preserve-comments-crlf.s. 2019-09-10 12:17:49 +00:00
.gitignore gitignore: Ignore Qt Creator project configuration files. NFC 2019-06-12 08:28:31 +00:00
CMakeLists.txt Revert "[utils] Implement the llvm-locstats tool" 2019-09-10 14:48:52 +00:00
CODE_OWNERS.TXT Update email address in CODE_OWNERS 2019-07-01 16:01:15 +00:00
configure
CREDITS.TXT Update email address. 2019-07-17 07:02:02 +00:00
LICENSE.TXT
llvm.spec.in
LLVMBuild.txt
README.txt
RELEASE_TESTERS.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.