[InstrProf] Add support for dead_strip+live_support functionality
authorVedant Kumar <vsk@apple.com>
Tue, 11 Oct 2016 21:48:16 +0000 (21:48 +0000)
committerVedant Kumar <vsk@apple.com>
Tue, 11 Oct 2016 21:48:16 +0000 (21:48 +0000)
commitde2ae96710eefed954dc263931ff4577f08dc694
tree0649bda3ac546b7b0ba4a2ee7fedca02ddaf8089
parenta09d11e108bbe12207dbfa22603869a2d87eacff
[InstrProf] Add support for dead_strip+live_support functionality

On Darwin, marking a section as "regular,live_support" means that a
symbol in the section should only be kept live if it has a reference to
something that is live. Otherwise, the linker is free to dead-strip it.

Turn this functionality on for the __llvm_prf_data section.

This means that counters and data associated with dead functions will be
removed from dead-stripped binaries. This will result in smaller
profiles and binaries, and should speed up profile collection.

Tested with check-profile, llvm-lit test/tools/llvm-{cov,profdata}, and
check-llvm.

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

llvm-svn: 283947
llvm/include/llvm/ProfileData/InstrProf.h
llvm/test/Instrumentation/InstrProfiling/PR23499.ll
llvm/test/Instrumentation/InstrProfiling/platform.ll
llvm/test/Instrumentation/InstrProfiling/profiling.ll