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