From cef33141560c42cf81b4284cef25777bb7e2f11e Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Fri, 26 Aug 2016 20:21:05 +0000 Subject: [Inliner] Report when inlining fails because callee's def is unavailable Summary: This is obviously an interesting case because it may motivate code restructuring or LTO. Reporting this requires instantiation of ORE in the loop where the call sites are first gathered. I've checked compile-time overhead *with* -Rpass-with-hotness and the worst slow-down was 6% in mcf and quickly tailing off. As before without -Rpass-with-hotness there is no overhead. Because this could be a pretty noisy diagnostics, it is currently qualified as 'verbose'. As of this patch, 'verbose' diagnostics are only emitted with -Rpass-with-hotness, i.e. when the output is expected to be filtered. Reviewers: eraman, chandlerc, davidxl, hfinkel Subscribers: tejohnson, Prazek, davide, llvm-commits Differential Revision: https://reviews.llvm.org/D23415 llvm-svn: 279860 --- llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'llvm/lib/Analysis') diff --git a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp index e150d9d2d82..09a4ce51472 100644 --- a/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp +++ b/llvm/lib/Analysis/OptimizationDiagnosticInfo.cpp @@ -68,29 +68,32 @@ void OptimizationRemarkEmitter::emitOptimizationRemark(const char *PassName, void OptimizationRemarkEmitter::emitOptimizationRemarkMissed( const char *PassName, const DebugLoc &DLoc, const Value *V, - const Twine &Msg) { + const Twine &Msg, bool IsVerbose) { LLVMContext &Ctx = F->getContext(); - Ctx.diagnose(DiagnosticInfoOptimizationRemarkMissed(PassName, *F, DLoc, Msg, - computeHotness(V))); + if (!IsVerbose || shouldEmitVerbose()) + Ctx.diagnose(DiagnosticInfoOptimizationRemarkMissed(PassName, *F, DLoc, Msg, + computeHotness(V))); } void OptimizationRemarkEmitter::emitOptimizationRemarkMissed( - const char *PassName, Loop *L, const Twine &Msg) { - emitOptimizationRemarkMissed(PassName, L->getStartLoc(), L->getHeader(), Msg); + const char *PassName, Loop *L, const Twine &Msg, bool IsVerbose) { + emitOptimizationRemarkMissed(PassName, L->getStartLoc(), L->getHeader(), Msg, + IsVerbose); } void OptimizationRemarkEmitter::emitOptimizationRemarkAnalysis( const char *PassName, const DebugLoc &DLoc, const Value *V, - const Twine &Msg) { + const Twine &Msg, bool IsVerbose) { LLVMContext &Ctx = F->getContext(); - Ctx.diagnose(DiagnosticInfoOptimizationRemarkAnalysis(PassName, *F, DLoc, Msg, - computeHotness(V))); + if (!IsVerbose || shouldEmitVerbose()) + Ctx.diagnose(DiagnosticInfoOptimizationRemarkAnalysis( + PassName, *F, DLoc, Msg, computeHotness(V))); } void OptimizationRemarkEmitter::emitOptimizationRemarkAnalysis( - const char *PassName, Loop *L, const Twine &Msg) { + const char *PassName, Loop *L, const Twine &Msg, bool IsVerbose) { emitOptimizationRemarkAnalysis(PassName, L->getStartLoc(), L->getHeader(), - Msg); + Msg, IsVerbose); } void OptimizationRemarkEmitter::emitOptimizationRemarkAnalysisFPCommute( -- cgit v1.2.3