summaryrefslogtreecommitdiff
path: root/lib/CodeGen/BranchFolding.h
diff options
context:
space:
mode:
authorHaicheng Wu <haicheng@codeaurora.org>2016-06-07 15:17:21 +0000
committerHaicheng Wu <haicheng@codeaurora.org>2016-06-07 15:17:21 +0000
commit63ca44cb857d02fe70bdc4a4ffcf7ddf2971b22f (patch)
tree56d14db7e86128afbe439206b44b45088d351ed7 /lib/CodeGen/BranchFolding.h
parentc9a83046c3f3ec30dc5c040e3af9bc6b01aa7bec (diff)
Revert "[MBP] Reduce code size by running tail merging in MBP."
This reverts commit r271930, r271915, r271923. They break a thumb selfhosting bot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.h')
-rw-r--r--lib/CodeGen/BranchFolding.h24
1 files changed, 6 insertions, 18 deletions
diff --git a/lib/CodeGen/BranchFolding.h b/lib/CodeGen/BranchFolding.h
index f7040990f13..d759d53e27f 100644
--- a/lib/CodeGen/BranchFolding.h
+++ b/lib/CodeGen/BranchFolding.h
@@ -20,24 +20,20 @@ namespace llvm {
class MachineBranchProbabilityInfo;
class MachineFunction;
class MachineModuleInfo;
- class MachineLoopInfo;
class RegScavenger;
class TargetInstrInfo;
class TargetRegisterInfo;
class LLVM_LIBRARY_VISIBILITY BranchFolder {
public:
- class MBFIWrapper;
-
explicit BranchFolder(bool defaultEnableTailMerge, bool CommonHoist,
- MBFIWrapper &MBFI,
+ const MachineBlockFrequencyInfo &MBFI,
const MachineBranchProbabilityInfo &MBPI);
- bool OptimizeFunction(MachineFunction &MF, const TargetInstrInfo *tii,
- const TargetRegisterInfo *tri, MachineModuleInfo *mmi,
- MachineLoopInfo *mli = nullptr,
- bool AfterPlacement = false);
-
+ bool OptimizeFunction(MachineFunction &MF,
+ const TargetInstrInfo *tii,
+ const TargetRegisterInfo *tri,
+ MachineModuleInfo *mmi);
private:
class MergePotentialsElt {
unsigned Hash;
@@ -95,16 +91,13 @@ namespace llvm {
};
std::vector<SameTailElt> SameTails;
- bool AfterBlockPlacement;
bool EnableTailMerge;
bool EnableHoistCommonCode;
const TargetInstrInfo *TII;
const TargetRegisterInfo *TRI;
MachineModuleInfo *MMI;
- MachineLoopInfo *MLI;
RegScavenger *RS;
- public:
/// \brief This class keeps track of branch frequencies of newly created
/// blocks and tail-merged blocks.
class MBFIWrapper {
@@ -112,18 +105,13 @@ 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;
};
- private:
- MBFIWrapper &MBBFreqInfo;
+ MBFIWrapper MBBFreqInfo;
const MachineBranchProbabilityInfo &MBPI;
bool TailMergeBlocks(MachineFunction &MF);