14 #ifndef LLVM_CODEGEN_TAILDUPLICATOR_H 15 #define LLVM_CODEGEN_TAILDUPLICATOR_H 27 class MachineBasicBlock;
28 class MachineBlockFrequencyInfo;
29 class MachineBranchProbabilityInfo;
30 class MachineFunction;
32 class MachineModuleInfo;
33 class MachineRegisterInfo;
34 class ProfileSummaryInfo;
35 class TargetRegisterInfo;
56 using AvailableValsTy = std::vector<std::pair<MachineBasicBlock *, unsigned>>;
74 bool LayoutMode,
unsigned TailDupSize = 0);
98 void addSSAUpdateEntry(
unsigned OrigReg,
unsigned NewReg,
117 bool tailDuplicate(
bool IsSimple,
126 void removeDeadBlock(
133 #endif // LLVM_CODEGEN_TAILDUPLICATOR_H bool shouldTailDuplicate(bool IsSimple, MachineBasicBlock &TailBB)
Determine if it is profitable to duplicate this block.
void initMF(MachineFunction &MF, bool PreRegAlloc, const MachineBranchProbabilityInfo *MBPI, const MachineBlockFrequencyInfo *MBFI, ProfileSummaryInfo *PSI, bool LayoutMode, unsigned TailDupSize=0)
Prepare to run on a specific machine function.
This class represents lattice values for constants.
Analysis providing profile information.
An efficient, type-erasing, non-owning reference to a callable.
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool tailDuplicateBlocks()
Look for small blocks that are unconditionally branched to and do not fall through.
TargetInstrInfo - Interface to description of machine instruction set.
static bool isSimpleBB(MachineBasicBlock *TailBB)
True if this BB has only one unconditional jump.
TargetInstrInfo::RegSubRegPair RegSubRegPair
bool tailDuplicateAndUpdate(bool IsSimple, MachineBasicBlock *MBB, MachineBasicBlock *ForcedLayoutPred, SmallVectorImpl< MachineBasicBlock *> *DuplicatedPreds=nullptr, function_ref< void(MachineBasicBlock *)> *RemovalCallback=nullptr)
Tail duplicate a single basic block into its predecessors, and then clean up.
bool canTailDuplicate(MachineBasicBlock *TailBB, MachineBasicBlock *PredBB)
Returns true if TailBB can successfully be duplicated into PredBB.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
A SetVector that performs no allocations if smaller than a certain size.
A pair composed of a register and a sub-register index.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
Utility class to perform tail duplication.
This class contains meta information specific to a module.