From 57783730fd3be5f35bff3444f90de9c44e150bb3 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Fri, 1 Dec 2017 18:12:29 +0000 Subject: Revert "[opt-remarks] If hotness threshold is set, ignore remarks without hotness" This reverts commit r319556. Something is not working with this when used with sample-based profiling. Investigating... llvm-svn: 319562 --- llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp b/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp index 91205d2f01e..ecc569dab83 100644 --- a/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp +++ b/llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp @@ -53,9 +53,10 @@ void MachineOptimizationRemarkEmitter::emit( LLVMContext &Ctx = MF.getFunction()->getContext(); - // Only emit it if its hotness meets the threshold. - if (OptDiag.getHotness().getValueOr(0) < - Ctx.getDiagnosticsHotnessThreshold()) { + // If a diagnostic has a hotness value, then only emit it if its hotness + // meets the threshold. + if (OptDiag.getHotness() && + *OptDiag.getHotness() < Ctx.getDiagnosticsHotnessThreshold()) { return; } -- cgit v1.2.3