LLVM: lib/Target/CSKY/CSKYConstantPoolValue.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_TARGET_CSKY_CONSTANTPOOLVALUE_H
14#define LLVM_TARGET_CSKY_CONSTANTPOOLVALUE_H
15
20#include
21
22namespace llvm {
23
29
42
43
44
45
47protected:
52
54
57 unsigned ID = 0);
58
59public:
65
74
76 Align Alignment) override;
77
79
81
83 return this->LabelId == A->LabelId && this->PCAdjust == A->PCAdjust &&
84 this->Modifier == A->Modifier;
85 }
86
87 template
89 const std::vector &Constants = CP->getConstants();
90 for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
91 if (Constants[i].isMachineConstantPoolEntry() &&
92 Constants[i].getAlign() >= Alignment) {
93 auto *CPV =
97 return i;
98 }
99 }
100
101 return -1;
102 }
103};
104
105
106
108 const Constant *CVal;
109
113
114public:
115 static CSKYConstantPoolConstant *
118 unsigned ID = 0);
119 static CSKYConstantPoolConstant *
126
128 Align Alignment) override;
131
132 bool equals(const CSKYConstantPoolConstant *A) const {
134 }
135
139};
140
141
142
144 const std::string S;
145
146 CSKYConstantPoolSymbol(Type *Ty, const char *S, unsigned PCAdjust,
149
150public:
151 static CSKYConstantPoolSymbol *Create(Type *Ty, const char *S,
154
156
158 Align Alignment) override;
161
162 bool equals(const CSKYConstantPoolSymbol *A) const {
164 }
165
169};
170
171
172
175
178
179public:
182
184
186 Align Alignment) override;
189
190 bool equals(const CSKYConstantPoolMBB *A) const {
192 }
193
197};
198
199
201 signed JTI;
202
203 CSKYConstantPoolJT(Type *Ty, int JTIndex, unsigned PCAdj,
205
206public:
207 static CSKYConstantPoolJT *Create(Type *Ty, int JTI, unsigned PCAdj,
209
211
213 Align Alignment) override;
216
217 bool equals(const CSKYConstantPoolJT *A) const {
219 }
220
222 return ACPV->isJT();
223 }
224};
225
226}
227
228#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.
const GlobalValue * getGV() const
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
void print(raw_ostream &O) const override
print - Implement operator<<
static CSKYConstantPoolConstant * Create(const Constant *C, CSKYCP::CSKYCPKind Kind, unsigned PCAdjust, CSKYCP::CSKYCPModifier Modifier, bool AddCurrentAddress, unsigned ID=0)
bool equals(const CSKYConstantPoolConstant *A) const
Definition CSKYConstantPoolValue.h:132
const BlockAddress * getBlockAddress() const
const Constant * getConstantPool() const
static bool classof(const CSKYConstantPoolValue *APV)
Definition CSKYConstantPoolValue.h:136
bool equals(const CSKYConstantPoolJT *A) const
Definition CSKYConstantPoolValue.h:217
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
static CSKYConstantPoolJT * Create(Type *Ty, int JTI, unsigned PCAdj, CSKYCP::CSKYCPModifier Modifier)
void print(raw_ostream &O) const override
print - Implement operator<<
signed getJTI()
Definition CSKYConstantPoolValue.h:210
static bool classof(const CSKYConstantPoolValue *ACPV)
Definition CSKYConstantPoolValue.h:221
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
static CSKYConstantPoolMBB * Create(Type *Ty, const MachineBasicBlock *Mbb, unsigned PCAdjust)
static bool classof(const CSKYConstantPoolValue *ACPV)
Definition CSKYConstantPoolValue.h:194
bool equals(const CSKYConstantPoolMBB *A) const
Definition CSKYConstantPoolValue.h:190
void print(raw_ostream &O) const override
print - Implement operator<<
const MachineBasicBlock * getMBB() const
Definition CSKYConstantPoolValue.h:183
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
void print(raw_ostream &O) const override
print - Implement operator<<
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
static bool classof(const CSKYConstantPoolValue *ACPV)
Definition CSKYConstantPoolValue.h:166
bool equals(const CSKYConstantPoolSymbol *A) const
Definition CSKYConstantPoolValue.h:162
StringRef getSymbol() const
Definition CSKYConstantPoolValue.h:155
static CSKYConstantPoolSymbol * Create(Type *Ty, const char *S, unsigned PCAdjust, CSKYCP::CSKYCPModifier Modifier)
bool isMachineBasicBlock() const
Definition CSKYConstantPoolValue.h:69
bool isGlobalValue() const
Definition CSKYConstantPoolValue.h:66
unsigned PCAdjust
Definition CSKYConstantPoolValue.h:49
unsigned getLabelID() const
Definition CSKYConstantPoolValue.h:64
void print(raw_ostream &O) const override
print - Implement operator<<
CSKYConstantPoolValue(Type *Ty, CSKYCP::CSKYCPKind Kind, unsigned PCAdjust, CSKYCP::CSKYCPModifier Modifier, bool AddCurrentAddress, unsigned ID=0)
bool equals(const CSKYConstantPoolValue *A) const
Definition CSKYConstantPoolValue.h:82
unsigned LabelId
Definition CSKYConstantPoolValue.h:53
unsigned getPCAdjustment() const
Definition CSKYConstantPoolValue.h:61
int getExistingMachineCPValueImpl(MachineConstantPool *CP, Align Alignment)
Definition CSKYConstantPoolValue.h:88
bool mustAddCurrentAddress() const
Definition CSKYConstantPoolValue.h:62
bool isBlockAddress() const
Definition CSKYConstantPoolValue.h:68
bool isConstPool() const
Definition CSKYConstantPoolValue.h:73
CSKYCP::CSKYCPKind Kind
Definition CSKYConstantPoolValue.h:48
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
CSKYCP::CSKYCPModifier Modifier
Definition CSKYConstantPoolValue.h:50
CSKYCP::CSKYCPModifier getModifier() const
Definition CSKYConstantPoolValue.h:63
bool isJT() const
Definition CSKYConstantPoolValue.h:72
bool isExtSymbol() const
Definition CSKYConstantPoolValue.h:67
const char * getModifierText() const
bool AddCurrentAddress
Definition CSKYConstantPoolValue.h:51
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
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.
This class implements an extremely fast bulk output stream that can only output to a stream.
CSKYCPModifier
Definition CSKYConstantPoolValue.h:40
@ ADDR
Definition CSKYConstantPoolValue.h:40
@ TLSIE
Definition CSKYConstantPoolValue.h:40
@ PLT
Definition CSKYConstantPoolValue.h:40
@ TLSGD
Definition CSKYConstantPoolValue.h:40
@ GOTOFF
Definition CSKYConstantPoolValue.h:40
@ NO_MOD
Definition CSKYConstantPoolValue.h:40
@ TLSLE
Definition CSKYConstantPoolValue.h:40
@ GOT
Definition CSKYConstantPoolValue.h:40
CSKYCPKind
Definition CSKYConstantPoolValue.h:31
@ CPValue
Definition CSKYConstantPoolValue.h:32
@ CPJT
Definition CSKYConstantPoolValue.h:36
@ CPConstPool
Definition CSKYConstantPoolValue.h:37
@ CPBlockAddress
Definition CSKYConstantPoolValue.h:34
@ CPMachineBasicBlock
Definition CSKYConstantPoolValue.h:35
@ CPExtSymbol
Definition CSKYConstantPoolValue.h:33
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ C
The default llvm calling convention, compatible with C.
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.
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.