summaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2017-12-01 17:02:04 +0000
committerAdam Nemet <anemet@apple.com>2017-12-01 17:02:04 +0000
commit7cb910a453a82d1f848d56e2a93bb55979d64937 (patch)
tree0f6b402cfb563546b9b155d27ac570c9e8c9804e /lib/Analysis
parent54b4cc42dbdd717cd68e1e2c1b1d0c7f3b77bb22 (diff)
[opt-remarks] If hotness threshold is set, ignore remarks without hotness
These are blocks that haven't not been executed during training. For large projects this could make a significant difference. For the project, I was looking at, I got an order of magnitude decrease in the size of the total YAML files with this and r319235. Differential Revision: https://reviews.llvm.org/D40678 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319556 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/OptimizationRemarkEmitter.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Analysis/OptimizationRemarkEmitter.cpp b/lib/Analysis/OptimizationRemarkEmitter.cpp
index cd6a9366801..4ff7611086e 100644
--- a/lib/Analysis/OptimizationRemarkEmitter.cpp
+++ b/lib/Analysis/OptimizationRemarkEmitter.cpp
@@ -75,11 +75,10 @@ void OptimizationRemarkEmitter::emit(
DiagnosticInfoOptimizationBase &OptDiagBase) {
auto &OptDiag = cast<DiagnosticInfoIROptimization>(OptDiagBase);
computeHotness(OptDiag);
- // If a diagnostic has a hotness value, then only emit it if its hotness
- // meets the threshold.
- if (OptDiag.getHotness() &&
- *OptDiag.getHotness() <
- F->getContext().getDiagnosticsHotnessThreshold()) {
+
+ // Only emit it if its hotness meets the threshold.
+ if (OptDiag.getHotness().getValueOr(0) <
+ F->getContext().getDiagnosticsHotnessThreshold()) {
return;
}