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/Analysis/OptimizationRemarkEmitter.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Analysis/OptimizationRemarkEmitter.cpp') diff --git a/llvm/lib/Analysis/OptimizationRemarkEmitter.cpp b/llvm/lib/Analysis/OptimizationRemarkEmitter.cpp index 4ff7611086e..cd6a9366801 100644 --- a/llvm/lib/Analysis/OptimizationRemarkEmitter.cpp +++ b/llvm/lib/Analysis/OptimizationRemarkEmitter.cpp @@ -75,10 +75,11 @@ void OptimizationRemarkEmitter::emit( DiagnosticInfoOptimizationBase &OptDiagBase) { auto &OptDiag = cast(OptDiagBase); computeHotness(OptDiag); - - // Only emit it if its hotness meets the threshold. - if (OptDiag.getHotness().getValueOr(0) < - F->getContext().getDiagnosticsHotnessThreshold()) { + // 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()) { return; } -- cgit v1.2.3