Go to the documentation of this file.
27 :
F(
F),
BFI(nullptr) {
28 if (!
F->getContext().getDiagnosticsHotnessRequested())
43 OwnedBFI = std::make_unique<BlockFrequencyInfo>(*
F, BPI, LI);
70 void OptimizationRemarkEmitter::computeHotness(
79 auto &OptDiag = cast<DiagnosticInfoIROptimization>(OptDiagBase);
80 computeHotness(OptDiag);
102 BFI = &getAnalysis<LazyBlockFrequencyInfoPass>().getBFI();
106 &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI())
108 PSI->getOrCompHotCountThreshold());
113 ORE = std::make_unique<OptimizationRemarkEmitter>(&Fn,
BFI);
124 AnalysisKey OptimizationRemarkEmitterAnalysis::Key;
140 PSI->getOrCompHotCountThreshold());
149 static const char ore_name[] =
"Optimization Remark Emitter";
150 #define ORE_NAME "opt-remark-emitter"
void setDiagnosticsHotnessThreshold(Optional< uint64_t > Threshold)
Set the minimum hotness value a diagnostic needs in order to be included in optimization diagnostics.
A set of analyses that are preserved following a run of a transformation pass.
An analysis over an "inner" IR unit that provides access to an analysis manager over a "outer" IR uni...
This is an optimization pass for GlobalISel generic memory operations.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
void setHotness(Optional< uint64_t > H)
bool invalidate(IRUnitT &IR, const PreservedAnalyses &PA)
Trigger the invalidation of some other analysis pass if not already handled and return whether it was...
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
static void getLazyBFIAnalysisUsage(AnalysisUsage &AU)
Helper for client passes to set up the analysis usage on behalf of this pass.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
Common features for diagnostics dealing with optimization remarks that are used by IR passes.
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...
const Value * getCodeRegion() const
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
void analyze(const DominatorTreeBase< BlockT, false > &DomTree)
Create the loop forest using a stable algorithm.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
void initializeOptimizationRemarkEmitterWrapperPassPass(PassRegistry &)
Optional< uint64_t > getHotness() const
Analysis providing branch probability information.
Represent the analysis usage information of a pass.
API to communicate dependencies between analyses during invalidation.
Analysis pass which computes BlockFrequencyInfo.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
Analysis providing profile information.
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
A special type used by analysis passes to provide an address that identifies that particular analysis...
An analysis pass based on legacy pass manager to deliver ProfileSummaryInfo.
An analysis pass based on the new PM to deliver ProfileSummaryInfo.
void recalculate(ParentType &Func)
recalculate - compute a dominator tree for the given function
bool isDiagnosticsHotnessThresholdSetFromPSI() const
Return if hotness threshold is requested from PSI.
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
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.
Optional< uint64_t > getBlockProfileCount(const BasicBlock *BB, bool AllowSynthetic=false) const
Returns the estimated profile count of BB.
A container for analyses that lazily runs them and caches their results.
FunctionPass class - This class is used to implement most global optimizations.
AnalysisUsage & addRequired()
constexpr T value_or(U &&alt) const &
LLVM Value Representation.