9 #ifndef LLVM_LIB_CODEGEN_BRANCHFOLDING_H 10 #define LLVM_LIB_CODEGEN_BRANCHFOLDING_H 24 class MachineBlockFrequencyInfo;
25 class MachineBranchProbabilityInfo;
26 class MachineFunction;
27 class MachineLoopInfo;
28 class MachineModuleInfo;
29 class MachineRegisterInfo;
30 class ProfileSummaryInfo;
32 class TargetInstrInfo;
33 class TargetRegisterInfo;
46 unsigned MinTailLength = 0);
54 bool AfterPlacement =
false);
57 class MergePotentialsElt {
63 : Hash(h), Block(b) {}
65 unsigned getHash()
const {
return Hash; }
72 bool operator<(
const MergePotentialsElt &)
const;
75 using MPIterator = std::vector<MergePotentialsElt>::iterator;
77 std::vector<MergePotentialsElt> MergePotentials;
87 : MPIter(mp), TailStartPos(tsp) {}
89 MPIterator getMPIter()
const {
93 MergePotentialsElt &getMergePotentialsElt()
const {
101 unsigned getHash()
const {
102 return getMergePotentialsElt().getHash();
106 return getMergePotentialsElt().getBlock();
109 bool tailIsWholeBlock()
const {
110 return TailStartPos == getBlock()->begin();
114 getMergePotentialsElt().setBlock(MBB);
121 std::vector<SameTailElt> SameTails;
123 bool AfterBlockPlacement;
124 bool EnableTailMerge;
125 bool EnableHoistCommonCode;
127 unsigned MinCommonTailLength;
149 uint64_t getEntryFreq()
const;
165 unsigned MinCommonTailLength);
189 unsigned ComputeSameTails(
unsigned CurHash,
unsigned minCommonTailLength,
202 unsigned maxCommonTailLength,
203 unsigned &commonTailIndex);
207 void mergeCommonTails(
unsigned commonTailIndex);
230 #endif // LLVM_LIB_CODEGEN_BRANCHFOLDING_H This class represents lattice values for constants.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
Analysis providing profile information.
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
unsigned const TargetRegisterInfo * TRI
const MachineBlockFrequencyInfo & getMBFI()
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.
#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...
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...
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.