[PGO] PGOFuncName in LTO optimizations
authorRong Xu <xur@google.com>
Wed, 30 Mar 2016 18:37:52 +0000 (18:37 +0000)
committerRong Xu <xur@google.com>
Wed, 30 Mar 2016 18:37:52 +0000 (18:37 +0000)
commitb534166fd4e2e2da1f6f717038c342d9199b0b32
tree319b0a82f64352eddf6c1b0cf52b4c32065ffbd0
parent747dc2eb61b51f5e26a72ec41fde038eca9b7efb
[PGO] PGOFuncName in LTO optimizations

PGOFuncNames are used as the key to retrieve the Function definition from the
MD5 stored in the profile. For internal linkage function, we prefix the source
file name to the PGOFuncNames. LTO's internalization privatizes many global linkage
symbols. This happens after value profile annotation, but those internal
linkage functions should not have a source prefix. To differentiate compiler
generated internal symbols from original ones, PGOFuncName meta data are
created and attached to the original internal symbols in the value profile
annotation step. If a symbol does not have the meta data, its original linkage
must be non-internal.

Also add a new map that maps PGOFuncName's MD5 value to the function definition.

Differential Revision: http://reviews.llvm.org/D17895

llvm-svn: 264902
llvm/include/llvm/ProfileData/InstrProf.h
llvm/lib/ProfileData/InstrProf.cpp
llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp