LLVM: include/llvm/CodeGen/TailDuplicator.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_CODEGEN_TAILDUPLICATOR_H

15#define LLVM_CODEGEN_TAILDUPLICATOR_H

16

21#include

22#include

23

24namespace llvm {

25

26template <typename T, unsigned int N> class SmallSetVector;

37

38

47 bool PreRegAlloc;

48 bool LayoutMode;

49 unsigned TailDupSize;

50

51

53

54

55

56 using AvailableValsTy = std::vector<std::pair<MachineBasicBlock *, Register>>;

57

59

60public:

61

62

63

64

65

66

67

68

69

74 bool LayoutMode, unsigned TailDupSize = 0);

75

79

80

82

83

84

85

86

87

88

89

96

97private:

99

118 bool tailDuplicate(bool IsSimple,

125 SmallVectorImpl<std::pair<Register, RegSubRegPair>> &CopyInfos,

127

128 void removeDeadBlock(

131};

132

133}

134

135#endif

This file defines the DenseMap class.

This file defines the DenseSet and SmallDenseSet classes.

bool isDead(const MachineInstr &MI, const MachineRegisterInfo &MRI)

This file defines the SmallVector class.

Implements a dense probed hash-table based set.

Representation of each machine instruction.

This class contains meta information specific to a module.

MachineRegisterInfo - Keep track of information for virtual and physical registers,...

Analysis providing profile information.

Wrapper class representing virtual and physical registers.

A SetVector that performs no allocations if smaller than a certain size.

This class consists of common code factored out of the SmallVector class to reduce code duplication b...

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

Utility class to perform tail duplication.

Definition TailDuplicator.h:39

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.

bool tailDuplicateBlocks()

Look for small blocks that are unconditionally branched to and do not fall through.

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.

static bool isSimpleBB(MachineBasicBlock *TailBB)

True if this BB has only one unconditional jump.

bool canTailDuplicate(MachineBasicBlock *TailBB, MachineBasicBlock *PredBB)

Returns true if TailBB can successfully be duplicated into PredBB.

bool shouldTailDuplicate(bool IsSimple, MachineBasicBlock &TailBB)

Determine if it is profitable to duplicate this block.

TargetInstrInfo - Interface to description of machine instruction set.

TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...

An efficient, type-erasing, non-owning reference to a callable.

This is an optimization pass for GlobalISel generic memory operations.

A pair composed of a register and a sub-register index.