#include "llvm/Transforms/Instrumentation/PGOCtxProfFlattening.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/Analysis/CtxProfAnalysis.h"
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/IR/Analysis.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/ProfileSummary.h"
#include "llvm/ProfileData/ProfileCommon.h"
#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
#include "llvm/Transforms/Scalar/DCE.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include <deque>
usingnamespacellvm;
namespace {
class ProfileAnnotator final { … };
[[maybe_unused]] bool areAllBBsReachable(const Function &F,
FunctionAnalysisManager &FAM) { … }
void clearColdFunctionProfile(Function &F) { … }
void removeInstrumentation(Function &F) { … }
}
PreservedAnalyses PGOCtxProfFlatteningPass::run(Module &M,
ModuleAnalysisManager &MAM) { … }