Include GUIDs from the same module when computing GUIDs that needs to be imported.
authorDehao Chen <dehao@google.com>
Wed, 1 Nov 2017 20:26:47 +0000 (20:26 +0000)
committerDehao Chen <dehao@google.com>
Wed, 1 Nov 2017 20:26:47 +0000 (20:26 +0000)
commitc6c051f2ea7bdc0780190be15928daa96e0f19b6
tree464c96c95f409dda2cdcc88cee9d84e32df29f4b
parent9cbe7c7f9348762c59c42fcad54df742180786bd
Include GUIDs from the same module when computing GUIDs that needs to be imported.

Summary: In the compile phase of SamplePGO+ThinLTO, ICP is not invoked. Instead, indirect call targets will be included as function metadata for ThinIndex to buidl the call graph. This should not only include functions defined in other modules, but also functions defined in the same module, otherwise ThinIndex may find the callee dead and eliminate it, while ICP in backend will revive the symbol, which leads to undefined symbol.

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits, mehdi_amini

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

llvm-svn: 317118
llvm/include/llvm/ProfileData/SampleProf.h
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/Transforms/SampleProfile/Inputs/function_metadata.prof [moved from llvm/test/Transforms/SampleProfile/Inputs/import.prof with 65% similarity]
llvm/test/Transforms/SampleProfile/function_metadata.ll [moved from llvm/test/Transforms/SampleProfile/import.ll with 52% similarity]