From cfca06d7963fa0909f90483b42a6d7d194d01e08 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 26 Jul 2020 19:36:28 +0000 Subject: Vendor import of llvm-project master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. --- llvm/lib/CodeGen/BranchFolding.h | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) (limited to 'llvm/lib/CodeGen/BranchFolding.h') diff --git a/llvm/lib/CodeGen/BranchFolding.h b/llvm/lib/CodeGen/BranchFolding.h index 7a4c68ea09f51..49c6bcae2db43 100644 --- a/llvm/lib/CodeGen/BranchFolding.h +++ b/llvm/lib/CodeGen/BranchFolding.h @@ -13,7 +13,6 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/CodeGen/LivePhysRegs.h" #include "llvm/CodeGen/MachineBasicBlock.h" -#include "llvm/Support/BlockFrequency.h" #include "llvm/Support/Compiler.h" #include #include @@ -21,21 +20,18 @@ namespace llvm { class BasicBlock; -class MachineBlockFrequencyInfo; class MachineBranchProbabilityInfo; class MachineFunction; class MachineLoopInfo; class MachineModuleInfo; class MachineRegisterInfo; +class MBFIWrapper; class ProfileSummaryInfo; -class raw_ostream; class TargetInstrInfo; class TargetRegisterInfo; class LLVM_LIBRARY_VISIBILITY BranchFolder { public: - class MBFIWrapper; - explicit BranchFolder(bool defaultEnableTailMerge, bool CommonHoist, MBFIWrapper &FreqInfo, @@ -49,7 +45,7 @@ class TargetRegisterInfo; /// given function. Block placement changes the layout and may create new /// tail merging opportunities. bool OptimizeFunction(MachineFunction &MF, const TargetInstrInfo *tii, - const TargetRegisterInfo *tri, MachineModuleInfo *mmi, + const TargetRegisterInfo *tri, MachineLoopInfo *mli = nullptr, bool AfterPlacement = false); @@ -128,32 +124,9 @@ class TargetRegisterInfo; const TargetInstrInfo *TII; const MachineRegisterInfo *MRI; const TargetRegisterInfo *TRI; - MachineModuleInfo *MMI; MachineLoopInfo *MLI; LivePhysRegs LiveRegs; - public: - /// This class keeps track of branch frequencies of newly created - /// blocks and tail-merged blocks. - class MBFIWrapper { - public: - MBFIWrapper(const MachineBlockFrequencyInfo &I) : MBFI(I) {} - - BlockFrequency getBlockFreq(const MachineBasicBlock *MBB) const; - void setBlockFreq(const MachineBasicBlock *MBB, BlockFrequency F); - raw_ostream &printBlockFreq(raw_ostream &OS, - const MachineBasicBlock *MBB) const; - raw_ostream &printBlockFreq(raw_ostream &OS, - const BlockFrequency Freq) const; - void view(const Twine &Name, bool isSimple = true); - uint64_t getEntryFreq() const; - const MachineBlockFrequencyInfo &getMBFI() { return MBFI; } - - private: - const MachineBlockFrequencyInfo &MBFI; - DenseMap MergedBBFreq; - }; - private: MBFIWrapper &MBBFreqInfo; const MachineBranchProbabilityInfo &MBPI; -- cgit v1.2.3