15 #ifndef LLVM_CODEGEN_TAILDUPLICATOR_H
16 #define LLVM_CODEGEN_TAILDUPLICATOR_H
49 typedef std::vector<std::pair<MachineBasicBlock *, unsigned>> AvailableValsTy;
64 bool LayoutMode,
unsigned TailDupSize = 0);
85 void addSSAUpdateEntry(
unsigned OrigReg,
unsigned NewReg,
104 bool tailDuplicate(
bool IsSimple,
113 void removeDeadBlock(
Implements a dense probed hash-table based set.
An efficient, type-erasing, non-owning reference to a callable.
static bool isSimpleBB(MachineBasicBlock *TailBB)
True if this BB has only one unconditional jump.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void initMF(MachineFunction &MF, const MachineBranchProbabilityInfo *MBPI, bool LayoutMode, unsigned TailDupSize=0)
Prepare to run on a specific machine function.
TargetInstrInfo - Interface to description of machine instruction set.
This file declares the machine register scavenger class.
bool shouldTailDuplicate(bool IsSimple, MachineBasicBlock &TailBB)
Determine if it is profitable to duplicate this block.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
bool canTailDuplicate(MachineBasicBlock *TailBB, MachineBasicBlock *PredBB)
Returns true if TailBB can successfully be duplicated into PredBB.
A SetVector that performs no allocations if smaller than a certain size.
bool tailDuplicateAndUpdate(bool IsSimple, MachineBasicBlock *MBB, MachineBasicBlock *ForcedLayoutPred, SmallVectorImpl< MachineBasicBlock * > *DuplicatedPreds=nullptr, llvm::function_ref< void(MachineBasicBlock *)> *RemovalCallback=nullptr)
Tail duplicate a single basic block into its predecessors, and then clean up.
A pair composed of a register and a sub-register index.
cl::opt< unsigned > TailDupIndirectBranchSize
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.
bool tailDuplicateBlocks()
Look for small blocks that are unconditionally branched to and do not fall through.
Utility class to perform tail duplication.
This class contains meta information specific to a module.