]> granicus.if.org Git - llvm/commit
[ThinLTO] For SamplePGO, need to handle ICP targets consistently in thin link
authorTeresa Johnson <tejohnson@google.com>
Wed, 13 Sep 2017 15:16:38 +0000 (15:16 +0000)
committerTeresa Johnson <tejohnson@google.com>
Wed, 13 Sep 2017 15:16:38 +0000 (15:16 +0000)
commit32ce91cfc3be690ef8e018517c2b57d4f726a3bf
treed9418fa598970f3878ab1309dc50ea5a392f928d
parent66341b5d6a0bb2b2fb499e6f35141c549c582b7f
[ThinLTO] For SamplePGO, need to handle ICP targets consistently in thin link

Summary:
SamplePGO indirect call profiles record the target as the original GUID
for statics. The importer had special handling to map to the normal GUID
in that case. The dead global analysis needs the same treatment or
inconsistencies arise, resulting in linker unsats due to some dead
symbols being exported and kept, leaving in references to other dead
symbols that are removed.

This can happen when a SamplePGO profile collected by one binary is used
for a different binary, so the indirect call profiles may not accurately
reflect live targets.

Reviewers: danielcdh

Subscribers: mehdi_amini, inglorion, llvm-commits, eraman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313151 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/FunctionImport.cpp
test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp2a.ll [new file with mode: 0644]
test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp2b.ll [new file with mode: 0644]
test/Transforms/PGOProfile/thinlto_samplepgo_icp2.ll [new file with mode: 0644]