Go to the documentation of this file.
14 #ifndef LLVM_CODEGEN_TAILDUPLICATOR_H
15 #define LLVM_CODEGEN_TAILDUPLICATOR_H
26 template <
typename T,
unsigned int N>
class SmallSetVector;
27 template <
typename Fn>
class function_ref;
29 class MachineBasicBlock;
30 class MachineBranchProbabilityInfo;
31 class MachineFunction;
33 class MachineModuleInfo;
34 class MachineRegisterInfo;
35 class ProfileSummaryInfo;
36 class TargetRegisterInfo;
57 using AvailableValsTy = std::vector<std::pair<MachineBasicBlock *, Register>>;
75 bool LayoutMode,
unsigned TailDupSize = 0);
119 bool tailDuplicate(
bool IsSimple,
129 void removeDeadBlock(
136 #endif // LLVM_CODEGEN_TAILDUPLICATOR_H
This is an optimization pass for GlobalISel generic memory operations.
void initMF(MachineFunction &MF, bool PreRegAlloc, const MachineBranchProbabilityInfo *MBPI, MBFIWrapper *MBFI, ProfileSummaryInfo *PSI, bool LayoutMode, unsigned TailDupSize=0)
Prepare to run on a specific machine function.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
bool shouldTailDuplicate(bool IsSimple, MachineBasicBlock &TailBB)
Determine if it is profitable to duplicate this block.
A pair composed of a register and a sub-register index.
static bool isSimpleBB(MachineBasicBlock *TailBB)
True if this BB has only one unconditional jump.
TargetInstrInfo - Interface to description of machine instruction set.
This class contains meta information specific to a module.
Analysis providing profile information.
An efficient, type-erasing, non-owning reference to a callable.
Implements a dense probed hash-table based set.
Representation of each machine instruction.
bool tailDuplicateAndUpdate(bool IsSimple, MachineBasicBlock *MBB, MachineBasicBlock *ForcedLayoutPred, SmallVectorImpl< MachineBasicBlock * > *DuplicatedPreds=nullptr, function_ref< void(MachineBasicBlock *)> *RemovalCallback=nullptr, SmallVectorImpl< MachineBasicBlock * > *CandidatePtr=nullptr)
Tail duplicate a single basic block into its predecessors, and then clean up.
TargetInstrInfo::RegSubRegPair RegSubRegPair
Wrapper class representing virtual and physical registers.
bool canTailDuplicate(MachineBasicBlock *TailBB, MachineBasicBlock *PredBB)
Returns true if TailBB can successfully be duplicated into PredBB.
Utility class to perform tail duplication.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
A SetVector that performs no allocations if smaller than a certain size.
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
bool tailDuplicateBlocks()
Look for small blocks that are unconditionally branched to and do not fall through.