1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/test/Instrumentation
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
..
AddressSanitizer [ASan] Version mismatch check follow-up 2019-08-29 20:20:05 +00:00
BoundsChecking Revert "[IRBuilder] Fold consistently for or/and whether constant is LHS or RHS" 2019-07-07 22:12:01 +00:00
DataFlowSanitizer IR: print value numbers for unnamed function arguments 2019-08-03 14:28:34 +00:00
HWAddressSanitizer hwasan: Untag unwound stack frames by wrapping personality functions. 2019-08-23 01:28:44 +00:00
InstrOrderFile
InstrProfiling [PGO] Use linkonce_odr linkage for __profd_ variables in comdat groups 2019-09-16 18:49:09 +00:00
MemorySanitizer MSan: handle callbr instructions 2019-07-03 09:28:50 +00:00
PoisonChecking [PoisonCheker] Support for out of bounds operands on shifts + insert/extractelement 2019-07-09 19:26:12 +00:00
SanitizerCoverage [NewPM][Sancov] Make Sancov a Module Pass instead of 2 Passes 2019-09-04 20:30:29 +00:00
ThreadSanitizer
cgprofile.ll