LLVM: lib/CodeGen/RegAllocBase.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36#ifndef LLVM_LIB_CODEGEN_REGALLOCBASE_H

37#define LLVM_LIB_CODEGEN_REGALLOCBASE_H

38

44

45namespace llvm {

46

56

57

58

59

60

61

62

64 virtual void anchor();

65

66protected:

73

74private:

75

77

78protected:

79

80

81

82

84

87 : shouldAllocateRegisterImpl(F) {}

88

90

91

93

94

96 if (!shouldAllocateRegisterImpl)

97 return true;

98 return shouldAllocateRegisterImpl(*TRI, *MRI, Reg);

99 }

100

101

102

104

105

106

108

109

110

113

114

116

117

119

120

122

123

125

126

127

128

129

132

133

134

135

138

139

142

143

145

146public:

147

149

150private:

151 void seedLiveRegs();

152};

153

154}

155

156#endif

This file defines the SmallPtrSet class.

This file defines the SmallSet class.

LiveInterval - This class represents the liveness of a register, or stack slot.

Wrapper class representing physical registers. Should be passed by value.

Representation of each machine instruction.

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

RegAllocBase(const RegAllocFilterFunc F=nullptr)

Definition RegAllocBase.h:86

virtual void aboutToRemoveInterval(const LiveInterval &LI)

Method called when the allocator is about to remove a LiveInterval.

Definition RegAllocBase.h:144

virtual MCRegister selectOrSplit(const LiveInterval &VirtReg, SmallVectorImpl< Register > &splitLVRs)=0

MCPhysReg getErrorAssignment(const TargetRegisterClass &RC, const MachineInstr *CtxMI=nullptr)

Query a physical register to use as a filler in contexts where the allocation has failed.

void enqueue(const LiveInterval *LI)

enqueue - Add VirtReg to the priority queue of unassigned registers.

virtual ~RegAllocBase()=default

void init(VirtRegMap &vrm, LiveIntervals &lis, LiveRegMatrix &mat)

SmallPtrSet< MachineInstr *, 32 > DeadRemats

Inst which is a def of an original reg and whose defs are already all dead after remat is saved in De...

Definition RegAllocBase.h:83

void cleanupFailedVReg(Register FailedVReg, MCRegister PhysReg, SmallVectorImpl< Register > &SplitRegs)

Perform cleanups on registers that failed to allocate.

SmallSet< Register, 2 > FailedVRegs

Definition RegAllocBase.h:85

virtual Spiller & spiller()=0

const TargetRegisterInfo * TRI

Definition RegAllocBase.h:67

LiveIntervals * LIS

Definition RegAllocBase.h:70

static const char TimerGroupName[]

Definition RegAllocBase.h:140

static const char TimerGroupDescription[]

Definition RegAllocBase.h:141

LiveRegMatrix * Matrix

Definition RegAllocBase.h:71

virtual const LiveInterval * dequeue()=0

dequeue - Return the next unassigned register, or NULL.

virtual void postOptimization()

VirtRegMap * VRM

Definition RegAllocBase.h:69

RegisterClassInfo RegClassInfo

Definition RegAllocBase.h:72

MachineRegisterInfo * MRI

Definition RegAllocBase.h:68

virtual void enqueueImpl(const LiveInterval *LI)=0

enqueue - Add VirtReg to the priority queue of unassigned registers.

bool shouldAllocateRegister(Register Reg)

Get whether a given register should be allocated.

Definition RegAllocBase.h:95

static bool VerifyEnabled

VerifyEnabled - True when -verify-regalloc is given.

Definition RegAllocBase.h:148

Wrapper class representing virtual and physical registers.

SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.

SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...

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

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

This is an optimization pass for GlobalISel generic memory operations.

std::function< bool(const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI, const Register Reg)> RegAllocFilterFunc

Filter function for register classes during regalloc.

uint16_t MCPhysReg

An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...