From 2adae76cc601a990ba0ab9881d636930d3cc3399 Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Sat, 28 Sep 2019 18:13:33 +0000 Subject: [NFC] Move hot cold splitting class to header file Summary: This is to facilitate unittests Reviewers: compnerd, vsk, tejohnson, sebpop, brzycki, SirishP Reviewed By: tejohnson Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68079 llvm-svn: 373151 --- llvm/lib/Transforms/IPO/HotColdSplitting.cpp | 31 ---------------------------- 1 file changed, 31 deletions(-) (limited to 'llvm/lib/Transforms/IPO') diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp index 49937a727fe..31571c4a20a 100644 --- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp +++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp @@ -85,12 +85,6 @@ static cl::opt "multiple of TCC_Basic)")); namespace { - -/// A sequence of basic blocks. -/// -/// A 0-sized SmallVector is slightly cheaper to move than a std::vector. -using BlockSequence = SmallVector; - // Same as blockEndsInUnreachable in CodeGen/BranchFolding.cpp. Do not modify // this function unless you modify the MBB version as well. // @@ -169,31 +163,6 @@ static bool markFunctionCold(Function &F, bool UpdateEntryCount = false) { return Changed; } -class HotColdSplitting { -public: - HotColdSplitting(ProfileSummaryInfo *ProfSI, - function_ref GBFI, - function_ref GTTI, - std::function *GORE, - function_ref LAC) - : PSI(ProfSI), GetBFI(GBFI), GetTTI(GTTI), GetORE(GORE), LookupAC(LAC) {} - bool run(Module &M); - -private: - bool isFunctionCold(const Function &F) const; - bool shouldOutlineFrom(const Function &F) const; - bool outlineColdRegions(Function &F, bool HasProfileSummary); - Function *extractColdRegion(const BlockSequence &Region, DominatorTree &DT, - BlockFrequencyInfo *BFI, TargetTransformInfo &TTI, - OptimizationRemarkEmitter &ORE, - AssumptionCache *AC, unsigned Count); - ProfileSummaryInfo *PSI; - function_ref GetBFI; - function_ref GetTTI; - std::function *GetORE; - function_ref LookupAC; -}; - class HotColdSplittingLegacyPass : public ModulePass { public: static char ID; -- cgit v1.2.3