OSDN Git Service

[profiling] Remove dead profile name vars after emitting name data
authorVedant Kumar <vsk@apple.com>
Tue, 14 Feb 2017 18:48:48 +0000 (18:48 +0000)
committerVedant Kumar <vsk@apple.com>
Tue, 14 Feb 2017 18:48:48 +0000 (18:48 +0000)
commit21ea8f286f75e4790716673e8024d2308347dec3
treecd102153b9c262aa70ee3175ce68a955a4b8dfeb
parent3ca564103abdd0c70f28f270873a2e535c245a6f
[profiling] Remove dead profile name vars after emitting name data

The profile name variables passed to counter increment intrinsics are
dead after we emit the finalized name data in __llvm_prf_nm. However, we
neglect to erase these name variables. This causes huge size increases
in the __TEXT,__const section as well as slowdowns when linker dead
stripping is disabled. Some affected projects are so massive that they
fail to link on Darwin, because only the small code model is supported.

Fix the issue by throwing away the name constants as soon as we're done
with them.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295084 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/InstrProfiling.cpp
test/Instrumentation/InstrProfiling/PR23499.ll
test/Instrumentation/InstrProfiling/platform.ll
test/Instrumentation/InstrProfiling/profiling.ll
test/Transforms/PGOProfile/comdat_internal.ll