26 : F(F),
BFI(nullptr) {
43 OwnedBFI = llvm::make_unique<BlockFrequencyInfo>(*F, BPI, LI);
66 void OptimizationRemarkEmitter::computeHotness(
75 auto &OptDiag = cast<DiagnosticInfoIROptimization>(OptDiagBase);
76 computeHotness(OptDiag);
97 BFI = &getAnalysis<LazyBlockFrequencyInfoPass>().getBFI();
101 ORE = llvm::make_unique<OptimizationRemarkEmitter>(&Fn,
BFI);
111 AnalysisKey OptimizationRemarkEmitterAnalysis::Key;
127 static const char ore_name[] =
"Optimization Remark Emitter";
128 #define ORE_NAME "opt-remark-emitter" bool invalidate(IRUnitT &IR, const PreservedAnalyses &PA)
Trigger the invalidation of some other analysis pass if not already handled and return whether it was...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
This class represents lattice values for constants.
void calculate(const Function &F, const LoopInfo &LI, const TargetLibraryInfo *TLI=nullptr)
void initializeOptimizationRemarkEmitterWrapperPassPass(PassRegistry &)
void recalculate(ParentType &Func)
recalculate - compute a dominator tree for the given function
constexpr T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION
block Block Frequency true
#define INITIALIZE_PASS_DEPENDENCY(depName)
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
A set of analyses that are preserved following a run of a transformation pass.
void analyze(const DominatorTreeBase< BlockT, false > &DomTree)
Create the loop forest using a stable algorithm.
uint64_t getDiagnosticsHotnessThreshold() const
Return the minimum hotness value a diagnostic would need in order to be included in optimization diag...
bool getDiagnosticsHotnessRequested() const
Return if a code hotness metric should be included in optimization diagnostics.
const Value * getCodeRegion() const
Represent the analysis usage information of a pass.
Common features for diagnostics dealing with optimization remarks that are used by IR passes...
FunctionPass class - This class is used to implement most global optimizations.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function. ...
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
Analysis pass which computes BlockFrequencyInfo.
Common features for diagnostics dealing with optimization remarks that are used by both IR and MIR pa...
void setPreservesAll()
Set by analyses that do not transform their input at all.
static void getLazyBFIAnalysisUsage(AnalysisUsage &AU)
Helper for client passes to set up the analysis usage on behalf of this pass.
Analysis providing branch probability information.
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
API to communicate dependencies between analyses during invalidation.
Optional< uint64_t > getHotness() const
LLVM Value Representation.
void setHotness(Optional< uint64_t > H)
A container for analyses that lazily runs them and caches their results.
A special type used by analysis passes to provide an address that identifies that particular analysis...
Optional< uint64_t > getBlockProfileCount(const BasicBlock *BB) const
Returns the estimated profile count of BB.