summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/LLVMContext.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index 6569695c996..ead65ecfdb8 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -199,8 +199,12 @@ static bool isDiagnosticEnabled(const DiagnosticInfo &DI) {
// pattern, passed via one of the -pass-remarks* flags, matches the name of
// the pass that is emitting the diagnostic. If there is no match, ignore the
// diagnostic and return.
+ //
+ // Also noisy remarks are only enabled if we have hotness information to sort
+ // them.
if (auto *Remark = dyn_cast<DiagnosticInfoOptimizationBase>(&DI))
- return Remark->isEnabled();
+ return Remark->isEnabled() &&
+ (!Remark->isVerbose() || Remark->getHotness());
return true;
}
OpenPOWER on IntegriCloud