LLVM: lib/Target/Xtensa/XtensaConstantPoolValue.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_LIB_TARGET_XTENSA_XTENSACONSTANTPOOLVALUE_H

14#define LLVM_LIB_TARGET_XTENSA_XTENSACONSTANTPOOLVALUE_H

15

19#include

20#include

21#include

22

23namespace llvm {

24

30

44

45

46

47

49 unsigned LabelId;

52

53

54protected:

58

62

63 template

65 const std::vector &Constants = CP->getConstants();

66 for (unsigned i = 0, e = Constants.size(); i != e; ++i) {

67 if (Constants[i].isMachineConstantPoolEntry() &&

68 (Constants[i].getAlign() >= Alignment)) {

70 Constants[i].Val.MachineCPVal);

73 return i;

74 }

75 }

76

77 return -1;

78 }

79

80public:

82

86

87 unsigned getLabelId() const { return LabelId; }

89

96

98 Align Alignment) override;

99

101

102

103

105

107 return this->LabelId == A->LabelId && this->Modifier == A->Modifier;

108 }

109

111

112#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)

113 void dump() const;

114#endif

115};

116

119 V.print(O);

120 return O;

121}

122

123

124

126 const Constant *CVal;

127

128 XtensaConstantPoolConstant(const Constant *C, unsigned ID,

130

131public:

132 static XtensaConstantPoolConstant *Create(const Constant *C, unsigned ID,

134

136

138 Align Alignment) override;

139

140

141

143

145

150

151 bool equals(const XtensaConstantPoolConstant *A) const {

153 }

154};

155

156

157

159 const std::string S;

160 bool PrivateLinkage;

161

162 XtensaConstantPoolSymbol(

163 LLVMContext &C, const char *S, unsigned Id, bool PrivLinkage,

165

166public:

167 static XtensaConstantPoolSymbol *

170

171 const char *getSymbol() const { return S.c_str(); }

172

174 Align Alignment) override;

175

177

178

179

181

183

185

189

190 bool equals(const XtensaConstantPoolSymbol *A) const {

192 }

193};

194

195

196

199

201 unsigned ID);

202

203public:

206

208

210 Align Alignment) override;

211

213

214

215

217

219

223

224 bool equals(const XtensaConstantPoolMBB *A) const {

226 }

227};

228

229

230

232 unsigned Idx;

233

234 XtensaConstantPoolJumpTable(LLVMContext &C, unsigned Idx);

235

236public:

237 static XtensaConstantPoolJumpTable *Create(LLVMContext &C, unsigned Idx);

238

239 unsigned getIndex() const { return Idx; }

240

242 Align Alignment) override;

243

245

246

247

249

251

255

256 bool equals(const XtensaConstantPoolJumpTable *A) const {

258 }

259};

260

261}

262

263#endif

static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")

This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...

The address of a basic block.

This is an important base class in LLVM.

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

This is an important class for using LLVM in a threaded context.

MachineConstantPoolValue(Type *ty)

The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...

StringRef - Represent a constant reference to a string, i.e.

The instances of the Type class are immutable: once they are created, they are never changed.

int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override

bool hasSameValue(XtensaConstantPoolValue *ACPV) override

hasSameValue - Return true if this Xtensa constpool value can share the same constantpool entry as an...

static bool classof(const XtensaConstantPoolValue *APV)

Definition XtensaConstantPoolValue.h:147

const BlockAddress * getBlockAddress() const

bool equals(const XtensaConstantPoolConstant *A) const

Definition XtensaConstantPoolValue.h:151

static XtensaConstantPoolConstant * Create(const Constant *C, unsigned ID, XtensaCP::XtensaCPKind Kind)

void print(raw_ostream &O) const override

print - Implement operator<<

void addSelectionDAGCSEId(FoldingSetNodeID &ID) override

static XtensaConstantPoolJumpTable * Create(LLVMContext &C, unsigned Idx)

unsigned getIndex() const

Definition XtensaConstantPoolValue.h:239

bool equals(const XtensaConstantPoolJumpTable *A) const

Definition XtensaConstantPoolValue.h:256

static bool classof(const XtensaConstantPoolValue *ACPV)

Definition XtensaConstantPoolValue.h:252

void addSelectionDAGCSEId(FoldingSetNodeID &ID) override

void print(raw_ostream &O) const override

print - Implement operator<<

int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override

bool hasSameValue(XtensaConstantPoolValue *ACPV) override

hasSameValue - Return true if this Xtensa constpool value can share the same constantpool entry as an...

static bool classof(const XtensaConstantPoolValue *ACPV)

Definition XtensaConstantPoolValue.h:220

bool equals(const XtensaConstantPoolMBB *A) const

Definition XtensaConstantPoolValue.h:224

static XtensaConstantPoolMBB * Create(LLVMContext &C, const MachineBasicBlock *M, unsigned ID)

void print(raw_ostream &O) const override

print - Implement operator<<

bool hasSameValue(XtensaConstantPoolValue *ACPV) override

hasSameValue - Return true if this Xtensa constpool value can share the same constantpool entry as an...

void addSelectionDAGCSEId(FoldingSetNodeID &ID) override

int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override

const MachineBasicBlock * getMBB() const

Definition XtensaConstantPoolValue.h:207

void addSelectionDAGCSEId(FoldingSetNodeID &ID) override

bool equals(const XtensaConstantPoolSymbol *A) const

Definition XtensaConstantPoolValue.h:190

static bool classof(const XtensaConstantPoolValue *ACPV)

Definition XtensaConstantPoolValue.h:186

void print(raw_ostream &O) const override

print - Implement operator<<

static XtensaConstantPoolSymbol * Create(LLVMContext &C, const char *S, unsigned ID, bool PrivLinkage, XtensaCP::XtensaCPModifier Modifier=XtensaCP::no_modifier)

int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override

bool hasSameValue(XtensaConstantPoolValue *ACPV) override

hasSameValue - Return true if this Xtensa constpool value can share the same constantpool entry as an...

const char * getSymbol() const

Definition XtensaConstantPoolValue.h:171

bool isPrivateLinkage()

Definition XtensaConstantPoolValue.h:182

XtensaConstantPoolValue - Xtensa specific constantpool value.

Definition XtensaConstantPoolValue.h:48

virtual bool hasSameValue(XtensaConstantPoolValue *ACPV)

hasSameValue - Return true if this Xtensa constpool value can share the same constantpool entry as an...

bool isJumpTable() const

Definition XtensaConstantPoolValue.h:95

bool isExtSymbol() const

Definition XtensaConstantPoolValue.h:90

~XtensaConstantPoolValue() override

int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override

int getExistingMachineCPValueImpl(MachineConstantPool *CP, Align Alignment)

Definition XtensaConstantPoolValue.h:64

void print(raw_ostream &O) const override

print - Implement operator<<

bool equals(const XtensaConstantPoolValue *A) const

Definition XtensaConstantPoolValue.h:106

bool hasModifier() const

Definition XtensaConstantPoolValue.h:84

unsigned getLabelId() const

Definition XtensaConstantPoolValue.h:87

XtensaConstantPoolValue(Type *Ty, unsigned ID, XtensaCP::XtensaCPKind Kind, XtensaCP::XtensaCPModifier Modifier=XtensaCP::no_modifier)

StringRef getModifierText() const

bool isMachineBasicBlock() const

Definition XtensaConstantPoolValue.h:92

bool isBlockAddress() const

Definition XtensaConstantPoolValue.h:91

void setLabelId(unsigned ID)

Definition XtensaConstantPoolValue.h:88

void addSelectionDAGCSEId(FoldingSetNodeID &ID) override

XtensaCP::XtensaCPModifier getModifier() const

Definition XtensaConstantPoolValue.h:83

This class implements an extremely fast bulk output stream that can only output to a stream.

unsigned ID

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

@ C

The default llvm calling convention, compatible with C.

XtensaCPKind

Definition XtensaConstantPoolValue.h:32

@ CPBlockAddress

Definition XtensaConstantPoolValue.h:34

@ CPMachineBasicBlock

Definition XtensaConstantPoolValue.h:35

@ CPExtSymbol

Definition XtensaConstantPoolValue.h:33

@ CPJumpTable

Definition XtensaConstantPoolValue.h:36

XtensaCPModifier

Definition XtensaConstantPoolValue.h:39

@ TPOFF

Definition XtensaConstantPoolValue.h:41

@ no_modifier

Definition XtensaConstantPoolValue.h:40

This is an optimization pass for GlobalISel generic memory operations.

MaybeAlign getAlign(const CallInst &I, unsigned Index)

decltype(auto) dyn_cast(const From &Val)

dyn_cast - Return the argument parameter cast to the specified type.

raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)

decltype(auto) cast(const From &Val)

cast - Return the argument parameter cast to the specified type.

This struct is a compact representation of a valid (non-zero power of two) alignment.