summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/LTOCodeGenerator.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/LTOCodeGenerator.cpp
parent061f3589ccae489989c4a501dab733b9605cb0e4 (diff)
downloadbcm5719-llvm-b4ce3573c435aca292e3e919ed8103a054be5616.tar.gz
bcm5719-llvm-b4ce3573c435aca292e3e919ed8103a054be5616.zip
[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/LTOCodeGenerator.cpp')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index ffe9af74cdc..939d12a20be 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -89,6 +89,12 @@ cl::opt<bool> LTOPassRemarksWithHotness(
"lto-pass-remarks-with-hotness",
cl::desc("With PGO, include profile count in optimization remarks"),
cl::Hidden);
+
+cl::opt<unsigned> LTOPassRemarksHotnessThreshold(
+ "lto-pass-remarks-hotness-threshold",
+ cl::desc("Minimum profile count required for an optimization remark to be "
+ "output"),
+ cl::Hidden);
}
LTOCodeGenerator::LTOCodeGenerator(LLVMContext &Context)
@@ -505,7 +511,8 @@ bool LTOCodeGenerator::optimize(bool DisableVerify, bool DisableInline,
return false;
auto DiagFileOrErr = lto::setupOptimizationRemarks(
- Context, LTORemarksFilename, LTOPassRemarksWithHotness);
+ Context, LTORemarksFilename, LTOPassRemarksWithHotness,
+ LTOPassRemarksHotnessThreshold);
if (!DiagFileOrErr) {
errs() << "Error: " << toString(DiagFileOrErr.takeError()) << "\n";
report_fatal_error("Can't get an output file for the remarks");
OpenPOWER on IntegriCloud