diff options
| author | Adam Nemet <anemet@apple.com> | 2017-12-01 17:02:04 +0000 |
|---|---|---|
| committer | Adam Nemet <anemet@apple.com> | 2017-12-01 17:02:04 +0000 |
| commit | 8d1fc2b65b4b16406e0cf7be3fe64a57f894d69f (patch) | |
| tree | 733f43c7d6a1d3b7d58a89703b8e98feffa83229 /llvm/lib/CodeGen | |
| parent | 3b70e75780fc68864990c89dd3269f664225400d (diff) | |
| download | bcm5719-llvm-8d1fc2b65b4b16406e0cf7be3fe64a57f894d69f.tar.gz bcm5719-llvm-8d1fc2b65b4b16406e0cf7be3fe64a57f894d69f.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
llvm-svn: 319556
Diffstat (limited to 'llvm/lib/CodeGen')
| -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; } |

