diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/LTO/LTOCodeGenerator.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp index 5aa91c4c689..6af31e61f94 100644 --- a/llvm/lib/LTO/LTOCodeGenerator.cpp +++ b/llvm/lib/LTO/LTOCodeGenerator.cpp @@ -96,6 +96,11 @@ cl::opt<std::string> LTORemarksFilename("lto-pass-remarks-output", cl::desc("Output filename for pass remarks"), cl::value_desc("filename")); + +cl::opt<bool> LTOPassRemarksWithHotness( + "lto-pass-remarks-with-hotness", + cl::desc("With PGO, include profile count in optimization remarks"), + cl::Hidden); } LTOCodeGenerator::LTOCodeGenerator(LLVMContext &Context) @@ -513,6 +518,10 @@ bool LTOCodeGenerator::setupOptimizationRemarks() { Context.setDiagnosticsOutputFile( llvm::make_unique<yaml::Output>(DiagnosticOutputFile->os())); } + + if (LTOPassRemarksWithHotness) + Context.setDiagnosticHotnessRequested(true); + return true; } diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp index 2a75b8bbef7..ae5d8a0255f 100644 --- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp @@ -65,6 +65,7 @@ namespace llvm { // Flags -discard-value-names, defined in LTOCodeGenerator.cpp extern cl::opt<bool> LTODiscardValueNames; extern cl::opt<std::string> LTORemarksFilename; +extern cl::opt<bool> LTOPassRemarksWithHotness; } namespace { @@ -74,6 +75,9 @@ static cl::opt<int> Expected<std::unique_ptr<tool_output_file>> setupOptimizationRemarks(LLVMContext &Ctx, int Count) { + if (LTOPassRemarksWithHotness) + Ctx.setDiagnosticHotnessRequested(true); + if (LTORemarksFilename.empty()) return nullptr; |