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

23

24namespace llvm {

25class MachineBasicBlock;

26

27

28

29

34

35public:

37};

38

39

41public:

44};

45

46

48public:

51};

52

53

54

55

56

57std::unique_ptr

59

60

61

62

63

64

65

66

67

68

69

71

73

78 std::unique_ptr CSEOpt;

79

80

81

82

84

85

86

87

89

90

92

94

96

99

100

102

104

105

106

109 void *&InsertPos);

110

111

112

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

114

115 bool HandlingRecordedInstrs = false;

116

117public:

119

121

123

125

126

127

128

129

130

132

133

135

136

137

138

140

141

142

144

146

148 CSEOpt = std::move(Opt);

149 }

150

151 bool shouldCSE(unsigned Opc) const;

152

154

156

158

159

164};

165

166class TargetRegisterClass;

167class RegisterBank;

168

169

173

174public:

177

183

187

189

191

195

198

201};

202

203

204

205

206

210 bool AlreadyComputed = false;

211

212public:

213

214

215

216

218 bool ReCompute = false);

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

222};

223

224

227

228public:

231

233

236

238

241 Wrapper.setComputed(false);

242 }

243};

244

245}

246

247#endif

unsigned const MachineRegisterInfo * MRI

amdgpu aa AMDGPU Address space based Alias Analysis Wrapper

This file defines the BumpPtrAllocator interface.

Analysis containing CSE Info

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.

Allocate memory in an ever growing pool, as if by bump-pointer.

bool shouldCSEOpc(unsigned Opc) override

virtual ~CSEConfigConstantOnly()=default

bool shouldCSEOpc(unsigned Opc) override

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

virtual ~CSEConfigFull()=default

Defines a builder that does CSE of MachineInstructions using GISelCSEInfo.

Lightweight error class with error context and mandatory checking.

Node - This class is used to maintain the singly linked bucket list in a folding set.

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...

The actual analysis pass wrapper.

const GISelCSEAnalysisWrapper & getCSEWrapper() const

void releaseMemory() override

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

void getAnalysisUsage(AnalysisUsage &AU) const override

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

bool runOnMachineFunction(MachineFunction &MF) override

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

GISelCSEAnalysisWrapper & getCSEWrapper()

GISelCSEAnalysisWrapperPass()

Simple wrapper that does the following.

void setComputed(bool Computed)

void setMF(MachineFunction &MFunc)

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

Takes a CSEConfigBase object that defines what opcodes get CSEd.

bool shouldCSE(unsigned Opc) const

void changingInstr(MachineInstr &MI) override

This instruction is about to be mutated in some way.

void analyze(MachineFunction &MF)

void changedInstr(MachineInstr &MI) override

This instruction was mutated in some way.

void recordNewInstruction(MachineInstr *MI)

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

void setMF(MachineFunction &MF)

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

void erasingInstr(MachineInstr &MI) override

An instruction is about to be erased.

void countOpcodeHit(unsigned Opc)

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

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.

void createdInstr(MachineInstr &MI) override

An instruction has been created and inserted into the function.

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

const GISelInstProfileBuilder & addNodeIDOpcode(unsigned Opc) const

const GISelInstProfileBuilder & addNodeIDRegNum(Register Reg) const

const GISelInstProfileBuilder & addNodeIDFlag(unsigned Flag) const

const GISelInstProfileBuilder & addNodeIDImmediate(int64_t Imm) const

const GISelInstProfileBuilder & addNodeIDReg(Register Reg) const

const GISelInstProfileBuilder & addNodeID(const MachineInstr *MI) const

const GISelInstProfileBuilder & addNodeIDMBB(const MachineBasicBlock *MBB) const

GISelInstProfileBuilder(FoldingSetNodeID &ID, const MachineRegisterInfo &MRI)

const GISelInstProfileBuilder & addNodeIDRegType(const LLT Ty) const

const GISelInstProfileBuilder & addNodeIDMachineOperand(const MachineOperand &MO) const

MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...

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.

This is an optimization pass for GlobalISel generic memory operations.

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

CodeGenOptLevel

Code generation optimization level.

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