summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
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/lib/IR
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/lib/IR')
-rw-r--r--llvm/lib/IR/LLVMContext.cpp7
-rw-r--r--llvm/lib/IR/LLVMContextImpl.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index ed3f10601bf..2e13f362344 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -132,6 +132,13 @@ bool LLVMContext::getDiagnosticsHotnessRequested() const {
return pImpl->DiagnosticsHotnessRequested;
}
+void LLVMContext::setDiagnosticsHotnessThreshold(uint64_t Threshold) {
+ pImpl->DiagnosticsHotnessThreshold = Threshold;
+}
+uint64_t LLVMContext::getDiagnosticsHotnessThreshold() const {
+ return pImpl->DiagnosticsHotnessThreshold;
+}
+
yaml::Output *LLVMContext::getDiagnosticsOutputFile() {
return pImpl->DiagnosticsOutputFile.get();
}
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h
index 8f4450e9278..395beb57fe3 100644
--- a/llvm/lib/IR/LLVMContextImpl.h
+++ b/llvm/lib/IR/LLVMContextImpl.h
@@ -1170,6 +1170,7 @@ public:
void *DiagnosticContext = nullptr;
bool RespectDiagnosticFilters = false;
bool DiagnosticsHotnessRequested = false;
+ uint64_t DiagnosticsHotnessThreshold = 0;
std::unique_ptr<yaml::Output> DiagnosticsOutputFile;
LLVMContext::YieldCallbackTy YieldCallback = nullptr;
OpenPOWER on IntegriCloud