LLVM: lib/Target/ARM/ARMConstantPoolValue.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_LIB_TARGET_ARM_ARMCONSTANTPOOLVALUE_H
14#define LLVM_LIB_TARGET_ARM_ARMCONSTANTPOOLVALUE_H
15
21#include
22#include
23
24namespace llvm {
25
34
57
58
59
60
62 unsigned LabelId;
64 unsigned char PCAdjust;
65
67 bool AddCurrentAddress;
68
69protected:
72 bool AddCurrentAddress);
73
76 bool AddCurrentAddress);
77
78 template
80 const std::vector &Constants = CP->getConstants();
81 for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
82 if (Constants[i].isMachineConstantPoolEntry() &&
83 Constants[i].getAlign() >= Alignment) {
84 auto *CPV =
88 return i;
89 }
90 }
91
92 return -1;
93 }
94
95public:
97
101
103
106
113
115 Align Alignment) override;
116
118
119
120
122
124 return this->LabelId == A->LabelId &&
125 this->PCAdjust == A->PCAdjust &&
126 this->Modifier == A->Modifier;
127 }
128
131 void dump() const;
132};
133
135 V.print(O);
136 return O;
137}
138
139
140
142 const Constant *CVal;
144
145 ARMConstantPoolConstant(const Constant *C,
146 unsigned ID,
148 unsigned char PCAdj,
150 bool AddCurrentAddress);
151 ARMConstantPoolConstant(Type *Ty, const Constant *C,
152 unsigned ID,
154 unsigned char PCAdj,
156 bool AddCurrentAddress);
158
159public:
160 static ARMConstantPoolConstant *Create(const Constant *C, unsigned ID);
164 const Constant *Initializer);
165 static ARMConstantPoolConstant *Create(const Constant *C, unsigned ID,
167 unsigned char PCAdj);
168 static ARMConstantPoolConstant *Create(const Constant *C, unsigned ID,
170 unsigned char PCAdj,
172 bool AddCurrentAddress);
173
176
178
180
184
186 Align Alignment) override;
187
188
189
191
193
195
200
201 bool equals(const ARMConstantPoolConstant *A) const {
203 }
204};
205
206
207
209 const std::string S;
210
213 bool AddCurrentAddress);
214
215public:
217 unsigned char PCAdj);
218
220
222 Align Alignment) override;
223
225
226
227
229
231
235
236 bool equals(const ARMConstantPoolSymbol *A) const {
238 }
239};
240
241
242
245
248 bool AddCurrentAddress);
249
250public:
253 unsigned ID, unsigned char PCAdj);
254
256
258 Align Alignment) override;
259
261
262
263
265
267
271
272 bool equals(const ARMConstantPoolMBB *A) const {
274 }
275};
276
277}
278
279#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 ...
This file defines the SmallPtrSet class.
const GlobalValue * getGV() const
bool equals(const ARMConstantPoolConstant *A) const
Definition ARMConstantPoolValue.h:201
static bool classof(const ARMConstantPoolValue *APV)
Definition ARMConstantPoolValue.h:196
static ARMConstantPoolConstant * Create(const Constant *C, unsigned ID)
iterator_range< promoted_iterator > promotedGlobals()
Definition ARMConstantPoolValue.h:179
const Constant * getPromotedGlobalInit() const
Definition ARMConstantPoolValue.h:181
bool hasSameValue(ARMConstantPoolValue *ACPV) override
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
void print(raw_ostream &O) const override
print - Implement operator<<
const BlockAddress * getBlockAddress() const
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
SmallPtrSet< const GlobalVariable *, 1 >::iterator promoted_iterator
Definition ARMConstantPoolValue.h:177
bool equals(const ARMConstantPoolMBB *A) const
Definition ARMConstantPoolValue.h:272
const MachineBasicBlock * getMBB() const
Definition ARMConstantPoolValue.h:255
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
static ARMConstantPoolMBB * Create(LLVMContext &C, const MachineBasicBlock *mbb, unsigned ID, unsigned char PCAdj)
bool hasSameValue(ARMConstantPoolValue *ACPV) override
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
void print(raw_ostream &O) const override
print - Implement operator<<
static bool classof(const ARMConstantPoolValue *ACPV)
Definition ARMConstantPoolValue.h:268
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
bool hasSameValue(ARMConstantPoolValue *ACPV) override
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
void print(raw_ostream &O) const override
print - Implement operator<<
static ARMConstantPoolSymbol * Create(LLVMContext &C, StringRef s, unsigned ID, unsigned char PCAdj)
static bool classof(const ARMConstantPoolValue *ACPV)
Definition ARMConstantPoolValue.h:232
StringRef getSymbol() const
Definition ARMConstantPoolValue.h:219
bool equals(const ARMConstantPoolSymbol *A) const
Definition ARMConstantPoolValue.h:236
ARMConstantPoolValue - ARM specific constantpool value.
Definition ARMConstantPoolValue.h:61
bool isPromotedGlobal() const
Definition ARMConstantPoolValue.h:112
unsigned char getPCAdjustment() const
Definition ARMConstantPoolValue.h:105
int getExistingMachineCPValue(MachineConstantPool *CP, Align Alignment) override
void print(raw_ostream *O) const
Definition ARMConstantPoolValue.h:130
ARMConstantPoolValue(Type *Ty, unsigned id, ARMCP::ARMCPKind Kind, unsigned char PCAdj, ARMCP::ARMCPModifier Modifier, bool AddCurrentAddress)
~ARMConstantPoolValue() override
void print(raw_ostream &O) const override
print - Implement operator<<
bool isMachineBasicBlock() const
Definition ARMConstantPoolValue.h:111
bool isExtSymbol() const
Definition ARMConstantPoolValue.h:108
int getExistingMachineCPValueImpl(MachineConstantPool *CP, Align Alignment)
Definition ARMConstantPoolValue.h:79
bool isGlobalValue() const
Definition ARMConstantPoolValue.h:107
bool equals(const ARMConstantPoolValue *A) const
Definition ARMConstantPoolValue.h:123
ARMCP::ARMCPModifier getModifier() const
Definition ARMConstantPoolValue.h:98
bool mustAddCurrentAddress() const
Definition ARMConstantPoolValue.h:102
StringRef getModifierText() const
bool hasModifier() const
Definition ARMConstantPoolValue.h:100
unsigned getLabelId() const
Definition ARMConstantPoolValue.h:104
virtual bool hasSameValue(ARMConstantPoolValue *ACPV)
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
bool isLSDA() const
Definition ARMConstantPoolValue.h:110
bool isBlockAddress() const
Definition ARMConstantPoolValue.h:109
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
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...
SmallPtrSetIterator< PtrType > iterator
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
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.
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
ARMCPKind
Definition ARMConstantPoolValue.h:37
@ CPMachineBasicBlock
Definition ARMConstantPoolValue.h:42
@ CPLSDA
Definition ARMConstantPoolValue.h:41
@ CPPromotedGlobal
Definition ARMConstantPoolValue.h:43
@ CPExtSymbol
Definition ARMConstantPoolValue.h:39
@ CPBlockAddress
Definition ARMConstantPoolValue.h:40
@ CPValue
Definition ARMConstantPoolValue.h:38
ARMCPModifier
Definition ARMConstantPoolValue.h:46
@ SECREL
Thread Pointer Offset.
Definition ARMConstantPoolValue.h:52
@ GOT_PREL
Thread Local Storage (General Dynamic Mode)
Definition ARMConstantPoolValue.h:49
@ SBREL
Section Relative (Windows TLS)
Definition ARMConstantPoolValue.h:53
@ TLSGD
None.
Definition ARMConstantPoolValue.h:48
@ GOTTPOFF
Global Offset Table, PC Relative.
Definition ARMConstantPoolValue.h:50
@ TPOFF
Global Offset Table, Thread Pointer Offset.
Definition ARMConstantPoolValue.h:51
@ no_modifier
Definition ARMConstantPoolValue.h:47
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.
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.