Put profile variables of COMDAT functions to it's own COMDAT group.
authorWei Mi <wmi@google.com>
Wed, 23 Sep 2015 22:40:45 +0000 (22:40 +0000)
committerWei Mi <wmi@google.com>
Wed, 23 Sep 2015 22:40:45 +0000 (22:40 +0000)
commit2f1d7a4c890b42b40a3102029074cd465b70dbb7
tree6bb1c8a0f5b069a13aeb535615122b636ea556cc
parentdbd50cefa173b5d2bcfbdb0dd62f3d145d589b44
Put profile variables of COMDAT functions to it's own COMDAT group.

In -fprofile-instr-generate compilation, to remove the redundant profile
variables for the COMDAT functions, these variables are placed in the same
COMDAT group as its associated function. This way when the COMDAT function
is not picked by the linker, those profile variables will also not be
output in the final binary. This may cause warning when mix link objects
built w and wo -fprofile-instr-generate.

This patch puts the profile variables for COMDAT functions to its own COMDAT
group to avoid the problem.

Patch by xur.
Differential Revision: http://reviews.llvm.org/D12248

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