10 #ifndef LLVM_LIB_CODEGEN_BRANCHFOLDING_H 11 #define LLVM_LIB_CODEGEN_BRANCHFOLDING_H 25 class MachineBlockFrequencyInfo;
26 class MachineBranchProbabilityInfo;
27 class MachineFunction;
28 class MachineLoopInfo;
29 class MachineModuleInfo;
30 class MachineRegisterInfo;
32 class TargetInstrInfo;
33 class TargetRegisterInfo;
45 unsigned MinTailLength = 0);
53 bool AfterPlacement =
false);
56 class MergePotentialsElt {
62 : Hash(h), Block(b) {}
64 unsigned getHash()
const {
return Hash; }
71 bool operator<(
const MergePotentialsElt &)
const;
74 using MPIterator = std::vector<MergePotentialsElt>::iterator;
76 std::vector<MergePotentialsElt> MergePotentials;
86 : MPIter(mp), TailStartPos(tsp) {}
88 MPIterator getMPIter()
const {
92 MergePotentialsElt &getMergePotentialsElt()
const {
100 unsigned getHash()
const {
101 return getMergePotentialsElt().getHash();
105 return getMergePotentialsElt().getBlock();
108 bool tailIsWholeBlock()
const {
109 return TailStartPos == getBlock()->begin();
113 getMergePotentialsElt().setBlock(MBB);
120 std::vector<SameTailElt> SameTails;
122 bool AfterBlockPlacement;
123 bool EnableTailMerge;
124 bool EnableHoistCommonCode;
126 unsigned MinCommonTailLength;
148 uint64_t getEntryFreq()
const;
162 unsigned MinCommonTailLength);
186 unsigned ComputeSameTails(
unsigned CurHash,
unsigned minCommonTailLength,
199 unsigned maxCommonTailLength,
200 unsigned &commonTailIndex);
204 void mergeCommonTails(
unsigned commonTailIndex);
227 #endif // LLVM_LIB_CODEGEN_BRANCHFOLDING_H This class represents lattice values for constants.
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
unsigned const TargetRegisterInfo * TRI
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
const HexagonInstrInfo * TII
static bool isSimple(Instruction *I)
TargetInstrInfo - Interface to description of machine instruction set.
unsigned const MachineRegisterInfo * MRI
LLVM Basic Block Representation.
MBFIWrapper(const MachineBlockFrequencyInfo &I)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This file implements the LivePhysRegs utility for tracking liveness of physical registers.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
A set of physical registers with utility functions to track liveness when walking backward/forward th...
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library...
bool operator<(int64_t V1, const APSInt &V2)
This class implements an extremely fast bulk output stream that can only output to a stream...
This class keeps track of branch frequencies of newly created blocks and tail-merged blocks...
This class contains meta information specific to a module.