10 #ifndef LLVM_LIB_CODEGEN_BRANCHFOLDING_H
11 #define LLVM_LIB_CODEGEN_BRANCHFOLDING_H
20 class MachineBlockFrequencyInfo;
21 class MachineBranchProbabilityInfo;
22 class MachineFunction;
23 class MachineModuleInfo;
24 class MachineLoopInfo;
25 class TargetInstrInfo;
26 class TargetRegisterInfo;
38 unsigned MinCommonTailLength = 0);
43 bool AfterPlacement =
false);
46 class MergePotentialsElt {
51 :
Hash(h), Block(b) {}
53 unsigned getHash()
const {
return Hash; }
60 bool operator<(
const MergePotentialsElt &)
const;
62 typedef std::vector<MergePotentialsElt>::iterator MPIterator;
63 std::vector<MergePotentialsElt> MergePotentials;
72 : MPIter(mp), TailStartPos(tsp) {}
74 MPIterator getMPIter()
const {
77 MergePotentialsElt &getMergePotentialsElt()
const {
83 unsigned getHash()
const {
84 return getMergePotentialsElt().getHash();
87 return getMergePotentialsElt().getBlock();
89 bool tailIsWholeBlock()
const {
90 return TailStartPos == getBlock()->
begin();
94 getMergePotentialsElt().setBlock(MBB);
100 std::vector<SameTailElt> SameTails;
102 bool AfterBlockPlacement;
103 bool EnableTailMerge;
104 bool EnableHoistCommonCode;
106 unsigned MinCommonTailLength;
132 MBFIWrapper &MBBFreqInfo;
138 unsigned MinCommonTailLength);
145 unsigned ComputeSameTails(
unsigned CurHash,
unsigned minCommonTailLength,
152 unsigned maxCommonTailLength,
153 unsigned &commonTailIndex);
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
const HexagonInstrInfo * TII
TargetInstrInfo - Interface to description of machine instruction set.
LLVM Basic Block Representation.
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library...
MBFIWrapper(const MachineBlockFrequencyInfo &I)
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...
A set of live physical registers with functions to track liveness when walking backward/forward throu...
bool operator<(int64_t V1, const APSInt &V2)
This class implements an extremely fast bulk output stream that can only output to a stream...
std::string Hash(const Unit &U)
This class keeps track of branch frequencies of newly created blocks and tail-merged blocks...
This class contains meta information specific to a module.