diff options
author | Teresa Johnson <tejohnson@google.com> | 2018-03-31 00:18:08 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2018-03-31 00:18:08 +0000 |
commit | db83aceb0686c25c1a5d3db2e776bc8c9b0de3ee (patch) | |
tree | ac6a07cb3f52668da666988bbe91008368731ebc /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | ef61d85fc9151a0cf588c98ea91b4849bfe79e25 (diff) | |
download | llvm-db83aceb0686c25c1a5d3db2e776bc8c9b0de3ee.zip llvm-db83aceb0686c25c1a5d3db2e776bc8c9b0de3ee.tar.gz llvm-db83aceb0686c25c1a5d3db2e776bc8c9b0de3ee.tar.bz2 |
[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
llvm-svn: 328909
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index b43a26f..99eef65 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -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) |