|
LLVM
5.0.0
|
The optimization diagnostic interface. More...
#include "llvm/Analysis/OptimizationDiagnosticInfo.h"
Public Member Functions | |
| OptimizationRemarkEmitter (const Function *F, BlockFrequencyInfo *BFI) | |
| OptimizationRemarkEmitter (const Function *F) | |
| This variant can be used to generate ORE on demand (without the analysis pass). More... | |
| OptimizationRemarkEmitter (OptimizationRemarkEmitter &&Arg) | |
| OptimizationRemarkEmitter & | operator= (OptimizationRemarkEmitter &&RHS) |
| bool | invalidate (Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv) |
| Handle invalidation events in the new pass manager. More... | |
| void | emit (DiagnosticInfoOptimizationBase &OptDiag) |
| Output the remark via the diagnostic handler and to the optimization record file. More... | |
| bool | allowExtraAnalysis () const |
| Whether we allow for extra compile-time budget to perform more analysis to produce fewer false positives. More... | |
The optimization diagnostic interface.
It allows reporting when optimizations are performed and when they are not along with the reasons for it. Hotness information of the corresponding code region can be included in the remark if DiagnosticsHotnessRequested is enabled in the LLVM context.
Definition at line 39 of file OptimizationDiagnosticInfo.h.
|
inline |
Definition at line 41 of file OptimizationDiagnosticInfo.h.
This variant can be used to generate ORE on demand (without the analysis pass).
Note that this ctor has a very different cost depending on whether F->getContext().getDiagnosticsHotnessRequested() is on or not. If it's off the operation is free.
Whereas if DiagnosticsHotnessRequested is on, it is fairly expensive operation since BFI and all its required analyses are computed. This is for example useful for CGSCC passes that can't use function analyses passes in the old PM.
Definition at line 26 of file OptimizationDiagnosticInfo.cpp.
References llvm::LoopInfoBase< N, M >::analyze(), llvm::BranchProbabilityInfo::calculate(), llvm::Function::getContext(), llvm::LLVMContext::getDiagnosticsHotnessRequested(), and llvm::DominatorTreeBase< N, IsPostDom >::recalculate().
|
inline |
Definition at line 57 of file OptimizationDiagnosticInfo.h.
|
inline |
Whether we allow for extra compile-time budget to perform more analysis to produce fewer false positives.
This is useful when reporting missed optimizations. In this case we can use the extra analysis (1) to filter trivial false positives or (2) to provide more context so that non-trivial false positives can be quickly detected by the user.
Definition at line 84 of file OptimizationDiagnosticInfo.h.
References llvm::Function::getContext(), and llvm::LLVMContext::getDiagnosticsOutputFile().
| void OptimizationRemarkEmitter::emit | ( | DiagnosticInfoOptimizationBase & | OptDiag | ) |
Output the remark via the diagnostic handler and to the optimization record file.
This is the new interface that should be now used rather than the legacy emit* APIs.
Definition at line 154 of file OptimizationDiagnosticInfo.cpp.
References llvm::LLVMContext::diagnose(), llvm::Function::getContext(), llvm::LLVMContext::getDiagnosticsHotnessThreshold(), llvm::LLVMContext::getDiagnosticsOutputFile(), and P.
Referenced by llvm::canSinkOrHoistInst(), computeUnrollCount(), hoist(), inlineCallsImpl(), isSafeToExecuteUnconditionally(), llvm::LoopVectorizePass::processLoop(), llvm::promoteLoopAccessesToScalars(), reportFastISelFailure(), reportLoadElim(), reportMayClobberedLoad(), shouldInline(), sink(), and llvm::UnrollLoop().
| bool OptimizationRemarkEmitter::invalidate | ( | Function & | F, |
| const PreservedAnalyses & | PA, | ||
| FunctionAnalysisManager::Invalidator & | Inv | ||
| ) |
Handle invalidation events in the new pass manager.
Definition at line 48 of file OptimizationDiagnosticInfo.cpp.
References llvm::AnalysisManager< T, TArgs >::Invalidator::invalidate().
|
inline |
Definition at line 60 of file OptimizationDiagnosticInfo.h.
1.8.6