diff options
author | Reid Kleckner <rnk@google.com> | 2019-02-08 19:03:50 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2019-02-08 19:03:50 +0000 |
commit | 987d331fab577b33255e93ce5a53850e36b9b180 (patch) | |
tree | 4d6f14f7d44f1d884bed60e20c287e9d98bf6e11 /compiler-rt/lib/profile/InstrProfilingValue.c | |
parent | eb6a47a46274378f8665057bf28ec62d266600dc (diff) | |
download | bcm5719-llvm-987d331fab577b33255e93ce5a53850e36b9b180.tar.gz bcm5719-llvm-987d331fab577b33255e93ce5a53850e36b9b180.zip |
[InstrProf] Implement static profdata registration
Summary:
The motivating use case is eliminating duplicate profile data registered
for the same inline function in two object files. Before this change,
users would observe multiple symbol definition errors with VC link, but
links with LLD would succeed.
Users (Mozilla) have reported that PGO works well with clang-cl and LLD,
but when using LLD without this static registration, we would get into a
"relocation against a discarded section" situation. I'm not sure what
happens in that situation, but I suspect that duplicate, unused profile
information was retained. If so, this change will reduce the size of
such binaries with LLD.
Now, Windows uses static registration and is in line with all the other
platforms.
Reviewers: davidxl, wmi, inglorion, void, calixte
Subscribers: mgorny, krytarowski, eraman, fedor.sergeev, hiraditya, #sanitizers, dmajor, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D57929
llvm-svn: 353547
Diffstat (limited to 'compiler-rt/lib/profile/InstrProfilingValue.c')
-rw-r--r-- | compiler-rt/lib/profile/InstrProfilingValue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/profile/InstrProfilingValue.c b/compiler-rt/lib/profile/InstrProfilingValue.c index 5f34c06bd52..b7c71768c2c 100644 --- a/compiler-rt/lib/profile/InstrProfilingValue.c +++ b/compiler-rt/lib/profile/InstrProfilingValue.c @@ -31,7 +31,7 @@ static int hasNonDefaultValsPerSite = 0; * allocated by the compiler. */ COMPILER_RT_VISIBILITY ValueProfNode lprofValueProfNodes[INSTR_PROF_VNODE_POOL_SIZE] COMPILER_RT_SECTION( - COMPILER_RT_SEG INSTR_PROF_VNODES_SECT_NAME_STR); + COMPILER_RT_SEG INSTR_PROF_VNODES_SECT_NAME); #endif COMPILER_RT_VISIBILITY uint32_t VPMaxNumValsPerSite = |