summaryrefslogtreecommitdiffstats
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.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.h b/llvm/lib/CodeGen/BranchFolding.h
index d759d53e27f..156641e351b 100644
--- a/llvm/lib/CodeGen/BranchFolding.h
+++ b/llvm/lib/CodeGen/BranchFolding.h
@@ -26,8 +26,10 @@ namespace llvm {
class LLVM_LIBRARY_VISIBILITY BranchFolder {
public:
+ class MBFIWrapper;
+
explicit BranchFolder(bool defaultEnableTailMerge, bool CommonHoist,
- const MachineBlockFrequencyInfo &MBFI,
+ MBFIWrapper &MBFI,
const MachineBranchProbabilityInfo &MBPI);
bool OptimizeFunction(MachineFunction &MF,
@@ -98,6 +100,7 @@ namespace llvm {
MachineModuleInfo *MMI;
RegScavenger *RS;
+ public:
/// \brief This class keeps track of branch frequencies of newly created
/// blocks and tail-merged blocks.
class MBFIWrapper {
@@ -105,13 +108,18 @@ namespace llvm {
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;
private:
const MachineBlockFrequencyInfo &MBFI;
DenseMap<const MachineBasicBlock *, BlockFrequency> MergedBBFreq;
};
- MBFIWrapper MBBFreqInfo;
+ private:
+ MBFIWrapper &MBBFreqInfo;
const MachineBranchProbabilityInfo &MBPI;
bool TailMergeBlocks(MachineFunction &MF);
OpenPOWER on IntegriCloud