LLVM 20.0.0git
|
The optimization diagnostic interface. More...
#include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
Public Member Functions | |
MachineOptimizationRemarkEmitter (MachineFunction &MF, MachineBlockFrequencyInfo *MBFI) | |
MachineOptimizationRemarkEmitter (MachineOptimizationRemarkEmitter &&)=default | |
bool | invalidate (MachineFunction &MF, const PreservedAnalyses &PA, MachineFunctionAnalysisManager::Invalidator &Inv) |
Handle invalidation events in the new pass manager. | |
void | emit (DiagnosticInfoOptimizationBase &OptDiag) |
Emit an optimization remark. | |
bool | allowExtraAnalysis (StringRef PassName) const |
Whether we allow for extra compile-time budget to perform more analysis to be more informative. | |
template<typename T > | |
void | emit (T RemarkBuilder, decltype(RemarkBuilder()) *=nullptr) |
Take a lambda that returns a remark which will be emitted. | |
MachineBlockFrequencyInfo * | getBFI () |
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 153 of file MachineOptimizationRemarkEmitter.h.
|
inline |
Definition at line 155 of file MachineOptimizationRemarkEmitter.h.
|
default |
Whether we allow for extra compile-time budget to perform more analysis to be more informative.
This is useful to enable additional missed optimizations to be reported that are normally too noisy. In this mode, 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 176 of file MachineOptimizationRemarkEmitter.h.
References llvm::Function::getContext(), llvm::LLVMContext::getDiagHandlerPtr(), llvm::MachineFunction::getFunction(), llvm::LLVMContext::getLLVMRemarkStreamer(), llvm::DiagnosticHandler::isAnyRemarkEnabled(), and PassName.
Referenced by llvm::AsmPrinter::emitFunctionBody().
void MachineOptimizationRemarkEmitter::emit | ( | DiagnosticInfoOptimizationBase & | OptDiag | ) |
Emit an optimization remark.
Definition at line 57 of file MachineOptimizationRemarkEmitter.cpp.
References llvm::LLVMContext::diagnose(), and llvm::LLVMContext::getDiagnosticsHotnessThreshold().
Referenced by emit(), llvm::AsmPrinter::emitFunctionBody(), and giveUpWithRemarks().
|
inline |
Take a lambda that returns a remark which will be emitted.
Second argument is only used to restrict this to functions.
Definition at line 186 of file MachineOptimizationRemarkEmitter.h.
References emit(), llvm::Function::getContext(), llvm::LLVMContext::getDiagHandlerPtr(), llvm::MachineFunction::getFunction(), llvm::LLVMContext::getLLVMRemarkStreamer(), and llvm::DiagnosticHandler::isAnyRemarkEnabled().
|
inline |
Definition at line 201 of file MachineOptimizationRemarkEmitter.h.
bool MachineOptimizationRemarkEmitter::invalidate | ( | MachineFunction & | MF, |
const PreservedAnalyses & | PA, | ||
MachineFunctionAnalysisManager::Invalidator & | Inv | ||
) |
Handle invalidation events in the new pass manager.
Definition at line 34 of file MachineOptimizationRemarkEmitter.cpp.
References llvm::AnalysisManager< IRUnitT, ExtraArgTs >::Invalidator::invalidate().