summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2017-06-30 23:14:53 +0000
committerBrian Gesiak <modocache@gmail.com>2017-06-30 23:14:53 +0000
commit4ef3daafef7c53d03bd221a323d34ae2cd47d14d (patch)
tree4fad026658b6f904209da704a666f75f6a0ca41a /llvm/tools
parent4fcfc19976c9abfb98008f67c973b99376580121 (diff)
downloadbcm5719-llvm-4ef3daafef7c53d03bd221a323d34ae2cd47d14d.tar.gz
bcm5719-llvm-4ef3daafef7c53d03bd221a323d34ae2cd47d14d.zip
[ORE] Add diagnostics hotness threshold
Summary: Add an option to prevent diagnostics that do not meet a minimum hotness threshold from being output. When generating optimization remarks for large codebases with a ton of cold code paths, this option can be used to limit the optimization remark output at a reasonable size. Discussion of this change can be read here: http://lists.llvm.org/pipermail/llvm-dev/2017-June/114377.html Reviewers: anemet, davidxl, hfinkel Reviewed By: anemet Subscribers: qcolombet, javed.absar, fhahn, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D34867 llvm-svn: 306912
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llc/llc.cpp8
-rw-r--r--llvm/tools/opt/opt.cpp8
2 files changed, 16 insertions, 0 deletions
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index cd2481bcf46..f13a19213c6 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -149,6 +149,11 @@ static cl::opt<bool> PassRemarksWithHotness(
cl::desc("With PGO, include profile count in optimization remarks"),
cl::Hidden);
+static cl::opt<unsigned> PassRemarksHotnessThreshold(
+ "pass-remarks-hotness-threshold",
+ cl::desc("Minimum profile count required for an optimization remark to be output"),
+ cl::Hidden);
+
static cl::opt<std::string>
RemarksFilename("pass-remarks-output",
cl::desc("YAML output filename for pass remarks"),
@@ -325,6 +330,9 @@ int main(int argc, char **argv) {
if (PassRemarksWithHotness)
Context.setDiagnosticsHotnessRequested(true);
+ if (PassRemarksHotnessThreshold)
+ Context.setDiagnosticsHotnessThreshold(PassRemarksHotnessThreshold);
+
std::unique_ptr<tool_output_file> YamlFile;
if (RemarksFilename != "") {
std::error_code EC;
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 480deac0201..24cce58047f 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -242,6 +242,11 @@ static cl::opt<bool> PassRemarksWithHotness(
cl::desc("With PGO, include profile count in optimization remarks"),
cl::Hidden);
+static cl::opt<unsigned> PassRemarksHotnessThreshold(
+ "pass-remarks-hotness-threshold",
+ cl::desc("Minimum profile count required for an optimization remark to be output"),
+ cl::Hidden);
+
static cl::opt<std::string>
RemarksFilename("pass-remarks-output",
cl::desc("YAML output filename for pass remarks"),
@@ -422,6 +427,9 @@ int main(int argc, char **argv) {
if (PassRemarksWithHotness)
Context.setDiagnosticsHotnessRequested(true);
+ if (PassRemarksHotnessThreshold)
+ Context.setDiagnosticsHotnessThreshold(PassRemarksHotnessThreshold);
+
std::unique_ptr<tool_output_file> YamlFile;
if (RemarksFilename != "") {
std::error_code EC;
OpenPOWER on IntegriCloud