LLVM: include/llvm/CodeGen/LiveRegMatrix.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#ifndef LLVM_CODEGEN_LIVEREGMATRIX_H

24#define LLVM_CODEGEN_LIVEREGMATRIX_H

25

29#include

30

31namespace llvm {

32

39

40class LiveRegMatrix {

46

47

48 unsigned UserTag = 0;

49

50

51 std::unique_ptrLiveIntervalUnion::Allocator LIUAlloc;

53

54

55 std::unique_ptrLiveIntervalUnion::Query\[\] Queries;

56

57

58 unsigned RegMaskTag = 0;

61

62 LiveRegMatrix()

64 void releaseMemory();

65

66public:

68

70

71

72

73

74

75

76

77

78

79

80

81

83

85

87

88

89

90

92

93

94

95

97

98

99

100

102 };

103

104

105

106

107

110

111

112

113

114

115

117

118

119

120

121

122

123

124

127

128

129

130

132

133

134

135

137

138

140

141

142

143

144

145

146

147

148

149

150

153

154

155

156

159

160

161

162

163

165

166

167

169 return &Matrix[static_cast<MCRegUnit>(0)];

170 }

171

173};

174

177

178public:

180

182

185

189};

190

200

201}

202

203#endif

This file implements the BitVector class.

Represent the analysis usage information of a pass.

Query interferences between a single live virtual register and a live interval union.

Union of live intervals that are strong candidates for coalescing into a single register (either phys...

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

This class represents the liveness of a register, stack slot, etc.

Definition LiveRegMatrix.h:191

LiveRegMatrix run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)

LiveRegMatrix Result

Definition LiveRegMatrix.h:196

void releaseMemory() override

releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...

LiveRegMatrixWrapperLegacy()

Definition LiveRegMatrix.h:181

const LiveRegMatrix & getLRM() const

Definition LiveRegMatrix.h:184

void getAnalysisUsage(AnalysisUsage &AU) const override

getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...

LiveRegMatrix & getLRM()

Definition LiveRegMatrix.h:183

static char ID

Definition LiveRegMatrix.h:179

bool runOnMachineFunction(MachineFunction &MF) override

runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...

Definition LiveRegMatrix.h:40

bool checkRegMaskInterference(const LiveInterval &VirtReg, MCRegister PhysReg=MCRegister::NoRegister)

Check for regmask interference only.

void unassign(const LiveInterval &VirtReg)

Unassign VirtReg from its PhysReg.

bool isPhysRegUsed(MCRegister PhysReg) const

Returns true if the given PhysReg has any live intervals assigned.

void invalidateVirtRegs()

Invalidate cached interference queries after modifying virtual register live ranges.

Definition LiveRegMatrix.h:82

friend class LiveRegMatrixWrapperLegacy

Definition LiveRegMatrix.h:41

Register getOneVReg(unsigned PhysReg) const

friend class LiveRegMatrixAnalysis

Definition LiveRegMatrix.h:42

LiveIntervalUnion::Query & query(const LiveRange &LR, MCRegUnit RegUnit)

Query a line of the assigned virtual register matrix directly.

InterferenceKind

Definition LiveRegMatrix.h:84

@ IK_VirtReg

Virtual register interference.

Definition LiveRegMatrix.h:91

@ IK_RegUnit

Register unit interference.

Definition LiveRegMatrix.h:96

@ IK_Free

No interference, go ahead and assign.

Definition LiveRegMatrix.h:86

@ IK_RegMask

RegMask interference.

Definition LiveRegMatrix.h:101

void init(MachineFunction &MF, LiveIntervals &LIS, VirtRegMap &VRM)

void assign(const LiveInterval &VirtReg, MCRegister PhysReg)

Assign VirtReg to PhysReg.

InterferenceKind checkInterference(const LiveInterval &VirtReg, MCRegister PhysReg)

Check for interference before assigning VirtReg to PhysReg.

bool checkRegUnitInterference(const LiveInterval &VirtReg, MCRegister PhysReg)

Check for regunit interference only.

LiveRegMatrix(LiveRegMatrix &&Other)=default

LiveIntervalUnion * getLiveUnions()

Directly access the live interval unions per regunit.

Definition LiveRegMatrix.h:168

LaneBitmask checkInterferenceLanes(SlotIndex Start, SlotIndex End, MCRegister PhysReg)

Check for interference in the segment [Start, End) that may prevent assignment to PhysReg,...

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

static constexpr unsigned NoRegister

MachineFunctionPass(char &ID)

Wrapper class representing virtual and physical registers.

SlotIndex - An opaque wrapper around machine indexes.

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

This is an optimization pass for GlobalISel generic memory operations.

AnalysisManager< MachineFunction > MachineFunctionAnalysisManager

Implement std::hash so that hash_code can be used in STL containers.

A CRTP mix-in that provides informational APIs needed for analysis passes.

A special type used by analysis passes to provide an address that identifies that particular analysis...