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

1

2

3

4

5

6

7

8

9

10

11

12#ifndef LLVM_CODEGEN_GLOBALISEL_CSEINFO_H

13#define LLVM_CODEGEN_GLOBALISEL_CSEINFO_H

14

24

25namespace llvm {

27

28

29

30

34 explicit UniqueMachineInstr(const MachineInstr *MI) : MI(MI) {}

35

36public:

38};

39

40

46

47

53

54

55

56

57

58LLVM_ABI std::unique_ptr

60

61

62

63

64

65

66

67

68

69

70

72

74

79 std::unique_ptr CSEOpt;

80

81

82

83

85

86

87

88

90

91

93

95

97

100

101

103

105

106

107

110 void *&InsertPos);

111

112

113

114 void insertInstr(MachineInstr *MI, void *InsertPos = nullptr);

115

116 bool HandlingRecordedInstrs = false;

117

118public:

120

122

124

126

127

128

129

130

131

133

134

136

137

138

139

141

142

143

145

147

149 CSEOpt = std::move(Opt);

150 }

151

152 bool shouldCSE(unsigned Opc) const;

153

155

156 void countOpcodeHit(unsigned Opc);

157

159

160

165};

166

167class TargetRegisterClass;

168class RegisterBank;

169

170

174

175public:

177 : ID(ID), MRI(MRI) {}

178

185

190

192

194

198

201

205};

206

207

208

209

210

214 bool AlreadyComputed = false;

215

216public:

217

218

219

220

222 bool ReCompute = false);

224 void setComputed(bool Computed) { AlreadyComputed = Computed; }

226};

227

228

231

232public:

235

237

240

242

244 Wrapper.releaseMemory();

245 Wrapper.setComputed(false);

246 }

247};

248

249}

250

251#endif

This file defines the BumpPtrAllocator interface.

static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)

This file defines a hash set that can be used to remove duplication of nodes in a graph.

This contains common code to allow clients to notify changes to machine instr.

Represent the analysis usage information of a pass.

bool shouldCSEOpc(unsigned Opc) override

~CSEConfigConstantOnly() override=default

bool shouldCSEOpc(unsigned Opc) override

------— CSEConfigFull -------— ///

~CSEConfigFull() override=default

Lightweight error class with error context and mandatory checking.

FoldingSetNodeID - This class is used to gather all the unique data bits of a node.

FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...

const GISelCSEAnalysisWrapper & getCSEWrapper() const

Definition CSEInfo.h:238

void releaseMemory() override

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

Definition CSEInfo.h:243

void getAnalysisUsage(AnalysisUsage &AU) const override

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

GISelCSEAnalysisWrapper & getCSEWrapper()

Definition CSEInfo.h:239

GISelCSEAnalysisWrapperPass()

static char ID

Definition CSEInfo.h:233

Simple wrapper that does the following.

Definition CSEInfo.h:211

void setComputed(bool Computed)

Definition CSEInfo.h:224

void setMF(MachineFunction &MFunc)

Definition CSEInfo.h:223

void releaseMemory()

Definition CSEInfo.h:225

LLVM_ABI GISelCSEInfo & get(std::unique_ptr< CSEConfigBase > CSEOpt, bool ReCompute=false)

Takes a CSEConfigBase object that defines what opcodes get CSEd.

The CSE Analysis object.

Definition CSEInfo.h:71

void recordNewInstruction(MachineInstr *MI)

Records a newly created inst in a list and lazily insert it to the CSEMap.

friend class CSEMIRBuilder

Definition CSEInfo.h:73

void setMF(MachineFunction &MF)

-----— GISelCSEInfo ----------—//

void setCSEConfig(std::unique_ptr< CSEConfigBase > Opt)

Definition CSEInfo.h:148

void handleRecordedInsts()

Use this callback to insert all the recorded instructions.

void handleRecordedInst(MachineInstr *MI)

Use this callback to inform CSE about a newly fully created instruction.

void handleRemoveInst(MachineInstr *MI)

Remove this inst from the CSE map.

Abstract class that contains various methods for clients to notify about changes.

LLVM_ABI const GISelInstProfileBuilder & addNodeIDOpcode(unsigned Opc) const

LLVM_ABI const GISelInstProfileBuilder & addNodeIDRegNum(Register Reg) const

LLVM_ABI const GISelInstProfileBuilder & addNodeIDFlag(unsigned Flag) const

LLVM_ABI const GISelInstProfileBuilder & addNodeIDImmediate(int64_t Imm) const

LLVM_ABI const GISelInstProfileBuilder & addNodeIDReg(Register Reg) const

LLVM_ABI const GISelInstProfileBuilder & addNodeID(const MachineInstr *MI) const

LLVM_ABI const GISelInstProfileBuilder & addNodeIDMBB(const MachineBasicBlock *MBB) const

GISelInstProfileBuilder(FoldingSetNodeID &ID, const MachineRegisterInfo &MRI)

Definition CSEInfo.h:176

LLVM_ABI const GISelInstProfileBuilder & addNodeIDRegType(const LLT Ty) const

LLVM_ABI const GISelInstProfileBuilder & addNodeIDMachineOperand(const MachineOperand &MO) const

MachineFunctionPass(char &ID)

Representation of each machine instruction.

MachineOperand class - Representation of each machine instruction operand.

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

This class implements the register bank concept.

Wrapper class representing virtual and physical registers.

A class that wraps MachineInstrs and derives from FoldingSetNode in order to be uniqued in a CSEMap.

Definition CSEInfo.h:31

friend class GISelCSEInfo

Definition CSEInfo.h:32

unsigned ID

LLVM IR allows to use arbitrary numbers as calling convention identifiers.

This is an optimization pass for GlobalISel generic memory operations.

FoldingSetBase::Node FoldingSetNode

LLVM_ABI std::unique_ptr< CSEConfigBase > getStandardCSEConfigForOpt(CodeGenOptLevel Level)

CodeGenOptLevel

Code generation optimization level.

BumpPtrAllocatorImpl<> BumpPtrAllocator

The standard BumpPtrAllocator which just uses the default template parameters.

All attributes(register class or bank and low-level type) a virtual register can have.