summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/BranchFolding.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.h')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.h31
1 files changed, 2 insertions, 29 deletions
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 <cstdint>
#include <vector>
@@ -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<const MachineBasicBlock *, BlockFrequency> MergedBBFreq;
- };
-
private:
MBFIWrapper &MBBFreqInfo;
const MachineBranchProbabilityInfo &MBPI;