27 Key = std::string(MKey);
42std::optional<uint64_t>
47 return MBFI->getBlockProfileCount(&MBB);
50void MachineOptimizationRemarkEmitter::computeHotness(
54 Remark.setHotness(computeHotness(*MBB));
59 auto &OptDiag = cast<DiagnosticInfoMIROptimization>(OptDiagCommon);
60 computeHotness(OptDiag);
82 MBFI = &getAnalysis<LazyMachineBlockFrequencyInfoPass>().getBFI();
86 ORE = std::make_unique<MachineOptimizationRemarkEmitter>(MF, MBFI);
97AnalysisKey MachineOptimizationRemarkEmitterAnalysis::Key;
110static const char ore_name[] =
"Machine Optimization Remark Emitter";
111#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)
API to communicate dependencies between analyses during invalidation.
bool invalidate(IRUnitT &IR, const PreservedAnalyses &PA)
Trigger the invalidation of some other analysis pass if not already handled and return whether it was...
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
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.
A set of analyses that are preserved following a run of a transformation 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 &)
A special type used by analysis passes to provide an address that identifies that particular analysis...
MachineArgument(StringRef Key, const MachineInstr &MI)
Print an entire MachineInstr.