27 Key = std::string(MKey);
34std::optional<uint64_t>
39 return MBFI->getBlockProfileCount(&MBB);
42void MachineOptimizationRemarkEmitter::computeHotness(
46 Remark.setHotness(computeHotness(*MBB));
51 auto &OptDiag = cast<DiagnosticInfoMIROptimization>(OptDiagCommon);
52 computeHotness(OptDiag);
74 MBFI = &getAnalysis<LazyMachineBlockFrequencyInfoPass>().getBFI();
78 ORE = std::make_unique<MachineOptimizationRemarkEmitter>(MF, MBFI);
90static const char ore_name[] =
"Machine Optimization Remark Emitter";
91#define ORE_NAME "machine-opt-remark-emitter"
===- LazyMachineBlockFrequencyInfo.h - Lazy Block Frequency -*- C++ -*–===//
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
Common features for diagnostics dealing with optimization remarks that are used by machine passes.
Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR pa...
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
This is an important class for using LLVM in a threaded context.
bool getDiagnosticsHotnessRequested() const
Return if a code hotness metric should be included in optimization diagnostics.
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
uint64_t getDiagnosticsHotnessThreshold() const
Return the minimum hotness value a diagnostic would need in order to be included in optimization diag...
This is an alternative analysis pass to MachineBlockFrequencyInfo.
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Function & getFunction()
Return the LLVM function that this machine code represents.
Representation of each machine instruction.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
virtual void print(raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
StringRef - Represent a constant reference to a string, i.e.
A raw_ostream that writes to an std::string.
This is an optimization pass for GlobalISel generic memory operations.
void initializeMachineOptimizationRemarkEmitterPassPass(PassRegistry &)
MachineArgument(StringRef Key, const MachineInstr &MI)
Print an entire MachineInstr.