10 #ifndef LLVM_LIB_CODEGEN_BRANCHFOLDING_H
11 #define LLVM_LIB_CODEGEN_BRANCHFOLDING_H
19 class MachineBlockFrequencyInfo;
20 class MachineBranchProbabilityInfo;
21 class MachineFunction;
22 class MachineModuleInfo;
24 class TargetInstrInfo;
25 class TargetRegisterInfo;
29 explicit BranchFolder(
bool defaultEnableTailMerge,
bool CommonHoist,
38 class MergePotentialsElt {
45 unsigned getHash()
const {
return Hash; }
52 bool operator<(
const MergePotentialsElt &)
const;
54 typedef std::vector<MergePotentialsElt>::iterator MPIterator;
55 std::vector<MergePotentialsElt> MergePotentials;
63 : MPIter(mp), TailStartPos(tsp) {}
65 MPIterator getMPIter()
const {
68 MergePotentialsElt &getMergePotentialsElt()
const {
74 unsigned getHash()
const {
75 return getMergePotentialsElt().getHash();
78 return getMergePotentialsElt().getBlock();
80 bool tailIsWholeBlock()
const {
81 return TailStartPos == getBlock()->
begin();
85 getMergePotentialsElt().setBlock(MBB);
91 std::vector<SameTailElt> SameTails;
94 bool EnableHoistCommonCode;
113 MBFIWrapper MBBFreqInfo;
127 unsigned ComputeSameTails(
unsigned CurHash,
unsigned minCommonTailLength,
134 unsigned maxCommonTailLength,
135 unsigned &commonTailIndex);
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
const HexagonInstrInfo * TII
TargetInstrInfo - Interface to description of machine instruction set.
bundle_iterator< MachineInstr, instr_iterator > iterator
LLVM Basic Block Representation.
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
bool operator<(int64_t V1, const APSInt &V2)
std::string Hash(const Unit &U)
MachineModuleInfo - This class contains meta information specific to a module.