#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/LazyBlockFrequencyInfo.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/InitializePasses.h"
#include <optional>
usingnamespacellvm;
OptimizationRemarkEmitter::OptimizationRemarkEmitter(const Function *F)
: … { … }
bool OptimizationRemarkEmitter::invalidate(
Function &F, const PreservedAnalyses &PA,
FunctionAnalysisManager::Invalidator &Inv) { … }
std::optional<uint64_t>
OptimizationRemarkEmitter::computeHotness(const Value *V) { … }
void OptimizationRemarkEmitter::computeHotness(
DiagnosticInfoIROptimization &OptDiag) { … }
void OptimizationRemarkEmitter::emit(
DiagnosticInfoOptimizationBase &OptDiagBase) { … }
OptimizationRemarkEmitterWrapperPass::OptimizationRemarkEmitterWrapperPass()
: … { … }
bool OptimizationRemarkEmitterWrapperPass::runOnFunction(Function &Fn) { … }
void OptimizationRemarkEmitterWrapperPass::getAnalysisUsage(
AnalysisUsage &AU) const { … }
AnalysisKey OptimizationRemarkEmitterAnalysis::Key;
OptimizationRemarkEmitter
OptimizationRemarkEmitterAnalysis::run(Function &F,
FunctionAnalysisManager &AM) { … }
char OptimizationRemarkEmitterWrapperPass::ID = …;
static const char ore_name[] = …;
#define ORE_NAME …
INITIALIZE_PASS_BEGIN(OptimizationRemarkEmitterWrapperPass, ORE_NAME, ore_name,
false, true)
INITIALIZE_PASS_DEPENDENCY(LazyBFIPass)
INITIALIZE_PASS_DEPENDENCY(ProfileSummaryInfoWrapperPass)
INITIALIZE_PASS_END(OptimizationRemarkEmitterWrapperPass, ORE_NAME, ore_name,
false, true)