[ThinLTO] Add an option to force summary call edges cold for debugging

Summary:
Useful to selectively disable importing into specific modules for
debugging/triaging/workarounds.

Reviewers: eraman

Subscribers: inglorion, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328909 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Teresa Johnson
2018-03-31 00:18:08 +00:00
parent 73d8dbf806
commit cc2d730bc4
6 changed files with 107 additions and 2 deletions
+5 -1
View File
@@ -89,6 +89,9 @@ static cl::opt<unsigned>
cl::opt<bool> WriteRelBFToSummary(
"write-relbf-to-summary", cl::Hidden, cl::init(false),
cl::desc("Write relative block frequency to function summary "));
extern FunctionSummary::ForceSummaryHotnessType ForceSummaryEdgesCold;
namespace {
/// These are manifest constants used by the bitcode writer. They do not need to
@@ -3436,7 +3439,8 @@ void ModuleBitcodeWriterBase::writePerModuleFunctionSummaryRecord(
for (auto &RI : FS->refs())
NameVals.push_back(VE.getValueID(RI.getValue()));
bool HasProfileData = F.hasProfileData();
bool HasProfileData =
F.hasProfileData() || ForceSummaryEdgesCold != FunctionSummary::FSHT_None;
for (auto &ECI : FS->calls()) {
NameVals.push_back(getValueId(ECI.first));
if (HasProfileData)