aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2018-02-26 18:37:45 +0000
committerAdam Nemet <anemet@apple.com>2018-02-26 18:37:45 +0000
commitb4ce3573c435aca292e3e919ed8103a054be5616 (patch)
tree594580de6ed815bbc671633affcd50648e1cf07b /llvm/lib/LTO/LTO.cpp
parent061f3589ccae489989c4a501dab733b9605cb0e4 (diff)
downloadllvm-b4ce3573c435aca292e3e919ed8103a054be5616.zip
llvm-b4ce3573c435aca292e3e919ed8103a054be5616.tar.gz
llvm-b4ce3573c435aca292e3e919ed8103a054be5616.tar.bz2
[LTO] Support filtering by hotness threshold
This wires up -pass-remarks-hotness-threshold to LTO and ThinLTO. Next is to change the clang driver to pass this with -fdiagnostics-hotness-threshold. Differential Revision: https://reviews.llvm.org/D41465 llvm-svn: 326107
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index e9ac314..58b1cd0 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -1202,10 +1202,10 @@ Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache) {
return BackendProc->wait();
}
-Expected<std::unique_ptr<ToolOutputFile>>
-lto::setupOptimizationRemarks(LLVMContext &Context,
- StringRef LTORemarksFilename,
- bool LTOPassRemarksWithHotness, int Count) {
+Expected<std::unique_ptr<ToolOutputFile>> lto::setupOptimizationRemarks(
+ LLVMContext &Context, StringRef LTORemarksFilename,
+ bool LTOPassRemarksWithHotness, unsigned LTOPassRemarksHotnessThreshold,
+ int Count) {
if (LTORemarksFilename.empty())
return nullptr;
@@ -1222,6 +1222,8 @@ lto::setupOptimizationRemarks(LLVMContext &Context,
llvm::make_unique<yaml::Output>(DiagnosticFile->os()));
if (LTOPassRemarksWithHotness)
Context.setDiagnosticsHotnessRequested(true);
+ if (LTOPassRemarksHotnessThreshold)
+ Context.setDiagnosticsHotnessThreshold(LTOPassRemarksHotnessThreshold);
DiagnosticFile->keep();
return std::move(DiagnosticFile);
}