class MachineOptimizationRemarkEmitter
Declaration
class MachineOptimizationRemarkEmitter { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h:151
Member Variables
- private llvm::MachineFunction& MF
- private llvm::MachineBlockFrequencyInfo* MBFI
- MBFI is only set if hotness is requested.
Method Overview
- public MachineOptimizationRemarkEmitter(llvm::MachineFunction & MF, llvm::MachineBlockFrequencyInfo * MBFI)
- public bool allowExtraAnalysis(llvm::StringRef PassName) const
- private Optional<uint64_t> computeHotness(const llvm::MachineBasicBlock & MBB)
- private void computeHotness(llvm::DiagnosticInfoMIROptimization & Remark)
- public void emit(llvm::DiagnosticInfoOptimizationBase & OptDiag)
- public template <typename T>void emit(T RemarkBuilder, decltype(RemarkBuilder()) * = nullptr)
- public llvm::MachineBlockFrequencyInfo * getBFI()
- private bool shouldEmitVerbose()
Methods
¶MachineOptimizationRemarkEmitter(
llvm::MachineFunction& MF,
llvm::MachineBlockFrequencyInfo* MBFI)
MachineOptimizationRemarkEmitter(
llvm::MachineFunction& MF,
llvm::MachineBlockFrequencyInfo* MBFI)
Declared at: llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h:153
Parameters
¶bool allowExtraAnalysis(
llvm::StringRef PassName) const
bool allowExtraAnalysis(
llvm::StringRef PassName) const
Description
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.
Declared at: llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h:167
Parameters
- llvm::StringRef PassName
¶Optional<uint64_t> computeHotness(
const llvm::MachineBasicBlock& MBB)
Optional<uint64_t> computeHotness(
const llvm::MachineBasicBlock& MBB)
Description
Compute hotness from IR value (currently assumed to be a block) if PGO is available.
Declared at: llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h:204
Parameters
- const llvm::MachineBasicBlock& MBB
¶void computeHotness(
llvm::DiagnosticInfoMIROptimization& Remark)
void computeHotness(
llvm::DiagnosticInfoMIROptimization& Remark)
Description
Similar but use value from \p OptDiag and update hotness there.
Declared at: llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h:207
Parameters
¶void emit(
llvm::DiagnosticInfoOptimizationBase& OptDiag)
void emit(
llvm::DiagnosticInfoOptimizationBase& OptDiag)
Description
Emit an optimization remark.
Declared at: llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h:158
Parameters
- llvm::DiagnosticInfoOptimizationBase& OptDiag
¶template <typename T>
void emit(T RemarkBuilder,
decltype(RemarkBuilder())* = nullptr)
template <typename T>
void emit(T RemarkBuilder,
decltype(RemarkBuilder())* = nullptr)
Description
Take a lambda that returns a remark which will be emitted. Second argument is only used to restrict this to functions.
Declared at: llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h:177
Templates
- T
Parameters
- T RemarkBuilder
- decltype(RemarkBuilder())* = nullptr
¶llvm::MachineBlockFrequencyInfo* getBFI()
llvm::MachineBlockFrequencyInfo* getBFI()
Declared at: llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h:192
¶bool shouldEmitVerbose()
bool shouldEmitVerbose()
Description
Only allow verbose messages if we know we're filtering by hotness (BFI is only set in this case).
Declared at: llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h:211