diff options
| author | Adam Nemet <anemet@apple.com> | 2017-12-01 20:41:38 +0000 |
|---|---|---|
| committer | Adam Nemet <anemet@apple.com> | 2017-12-01 20:41:38 +0000 |
| commit | 9303f62255b0344147d716bb3686dd8bae1d0a8a (patch) | |
| tree | 0cf80195b1a33e39df547c0408e43784771a9810 /llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp | |
| parent | 4f39b294aa997355334189f93c4726473ee43457 (diff) | |
| download | bcm5719-llvm-9303f62255b0344147d716bb3686dd8bae1d0a8a.tar.gz bcm5719-llvm-9303f62255b0344147d716bb3686dd8bae1d0a8a.zip | |
[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
Re-commit after fixing the failing testcase in rL319576, rL319577 and
rL319578.
llvm-svn: 319581
Diffstat (limited to 'llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp b/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp index ecc569dab83..91205d2f01e 100644 --- a/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp +++ b/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp @@ -53,10 +53,9 @@ void MachineOptimizationRemarkEmitter::emit( LLVMContext &Ctx = MF.getFunction()->getContext(); - // If a diagnostic has a hotness value, then only emit it if its hotness - // meets the threshold. - if (OptDiag.getHotness() && - *OptDiag.getHotness() < Ctx.getDiagnosticsHotnessThreshold()) { + // Only emit it if its hotness meets the threshold. + if (OptDiag.getHotness().getValueOr(0) < + Ctx.getDiagnosticsHotnessThreshold()) { return; } |

