@@ -30,12 +30,11 @@ class raw_ostream;
30
30
class MachineFunction ;
31
31
class ModuleSlotTracker ;
32
32
33
- // / MachinePointerInfo - This class contains a discriminated union of
34
- // / information about pointers in memory operands, relating them back to LLVM IR
35
- // / or to virtual locations (such as frame indices) that are exposed during
36
- // / codegen.
33
+ // / This class contains a discriminated union of information about pointers in
34
+ // / memory operands, relating them back to LLVM IR or to virtual locations (such
35
+ // / as frame indices) that are exposed during codegen.
37
36
struct MachinePointerInfo {
38
- // / V - This is the IR pointer value for the access, or it is null if unknown.
37
+ // / This is the IR pointer value for the access, or it is null if unknown.
39
38
// / If this is null, then the access is to a pointer in the default address
40
39
// / space.
41
40
PointerUnion<const Value *, const PseudoSourceValue *> V;
@@ -57,34 +56,30 @@ struct MachinePointerInfo {
57
56
return MachinePointerInfo (V.get <const PseudoSourceValue*>(), Offset+O);
58
57
}
59
58
60
- // / getAddrSpace - Return the LLVM IR address space number that this pointer
61
- // / points into.
59
+ // / Return the LLVM IR address space number that this pointer points into.
62
60
unsigned getAddrSpace () const ;
63
61
64
- // / getConstantPool - Return a MachinePointerInfo record that refers to the
65
- // / constant pool.
62
+ // / Return a MachinePointerInfo record that refers to the constant pool.
66
63
static MachinePointerInfo getConstantPool (MachineFunction &MF);
67
64
68
- // / getFixedStack - Return a MachinePointerInfo record that refers to the
69
- // / the specified FrameIndex.
65
+ // / Return a MachinePointerInfo record that refers to the specified
66
+ // / FrameIndex.
70
67
static MachinePointerInfo getFixedStack (MachineFunction &MF, int FI,
71
68
int64_t Offset = 0 );
72
69
73
- // / getJumpTable - Return a MachinePointerInfo record that refers to a
74
- // / jump table entry.
70
+ // / Return a MachinePointerInfo record that refers to a jump table entry.
75
71
static MachinePointerInfo getJumpTable (MachineFunction &MF);
76
72
77
- // / getGOT - Return a MachinePointerInfo record that refers to a
78
- // / GOT entry.
73
+ // / Return a MachinePointerInfo record that refers to a GOT entry.
79
74
static MachinePointerInfo getGOT (MachineFunction &MF);
80
75
81
- // / getStack - stack pointer relative access.
76
+ // / Stack pointer relative access.
82
77
static MachinePointerInfo getStack (MachineFunction &MF, int64_t Offset);
83
78
};
84
79
85
80
86
81
// ===----------------------------------------------------------------------===//
87
- // / MachineMemOperand - A description of a memory reference used in the backend.
82
+ // / A description of a memory reference used in the backend.
88
83
// / Instead of holding a StoreInst or LoadInst, this class holds the address
89
84
// / Value of the reference along with a byte size and offset. This allows it
90
85
// / to describe lowered loads and stores. Also, the special PseudoSourceValue
@@ -118,17 +113,17 @@ class MachineMemOperand {
118
113
MOMaxBits = 8
119
114
};
120
115
121
- // / MachineMemOperand - Construct an MachineMemOperand object with the
122
- // / specified PtrInfo, flags, size, and base alignment.
116
+ // / Construct a MachineMemOperand object with the specified PtrInfo, flags,
117
+ // / size, and base alignment.
123
118
MachineMemOperand (MachinePointerInfo PtrInfo, unsigned flags, uint64_t s,
124
119
unsigned base_alignment,
125
120
const AAMDNodes &AAInfo = AAMDNodes(),
126
121
const MDNode *Ranges = nullptr );
127
122
128
123
const MachinePointerInfo &getPointerInfo () const { return PtrInfo; }
129
124
130
- // / getValue - Return the base address of the memory access. This may either
131
- // / be a normal LLVM IR Value, or one of the special values used in CodeGen.
125
+ // / Return the base address of the memory access. This may either be a normal
126
+ // / LLVM IR Value, or one of the special values used in CodeGen.
132
127
// / Special values are those obtained via
133
128
// / PseudoSourceValue::getFixedStack(int), PseudoSourceValue::getStack, and
134
129
// / other PseudoSourceValue member functions which return objects which stand
@@ -142,34 +137,33 @@ class MachineMemOperand {
142
137
143
138
const void *getOpaqueValue () const { return PtrInfo.V .getOpaqueValue (); }
144
139
145
- // / getFlags - Return the raw flags of the source value, \see MemOperandFlags.
140
+ // / Return the raw flags of the source value, \see MemOperandFlags.
146
141
unsigned int getFlags () const { return Flags & ((1 << MOMaxBits) - 1 ); }
147
142
148
143
// / Bitwise OR the current flags with the given flags.
149
144
void setFlags (unsigned f) { Flags |= (f & ((1 << MOMaxBits) - 1 )); }
150
145
151
- // / getOffset - For normal values, this is a byte offset added to the base
152
- // / address. For PseudoSourceValue::FPRel values, this is the FrameIndex
153
- // / number.
146
+ // / For normal values, this is a byte offset added to the base address.
147
+ // / For PseudoSourceValue::FPRel values, this is the FrameIndex number.
154
148
int64_t getOffset () const { return PtrInfo.Offset ; }
155
149
156
150
unsigned getAddrSpace () const { return PtrInfo.getAddrSpace (); }
157
151
158
- // / getSize - Return the size in bytes of the memory reference.
152
+ // / Return the size in bytes of the memory reference.
159
153
uint64_t getSize () const { return Size ; }
160
154
161
- // / getAlignment - Return the minimum known alignment in bytes of the
162
- // / actual memory reference.
155
+ // / Return the minimum known alignment in bytes of the actual memory
156
+ // / reference.
163
157
uint64_t getAlignment () const ;
164
158
165
- // / getBaseAlignment - Return the minimum known alignment in bytes of the
166
- // / base address, without the offset.
159
+ // / Return the minimum known alignment in bytes of the base address, without
160
+ // / the offset.
167
161
uint64_t getBaseAlignment () const { return (1u << (Flags >> MOMaxBits)) >> 1 ; }
168
162
169
- // / getAAInfo - Return the AA tags for the memory reference.
163
+ // / Return the AA tags for the memory reference.
170
164
AAMDNodes getAAInfo () const { return AAInfo; }
171
165
172
- // / getRanges - Return the range tag for the memory reference.
166
+ // / Return the range tag for the memory reference.
173
167
const MDNode *getRanges () const { return Ranges; }
174
168
175
169
bool isLoad () const { return Flags & MOLoad; }
@@ -178,23 +172,23 @@ class MachineMemOperand {
178
172
bool isNonTemporal () const { return Flags & MONonTemporal; }
179
173
bool isInvariant () const { return Flags & MOInvariant; }
180
174
181
- // / isUnordered - Returns true if this memory operation doesn't have any
182
- // / ordering constraints other than normal aliasing. Volatile and atomic
183
- // / memory operations can't be reordered.
175
+ // / Returns true if this memory operation doesn't have any ordering
176
+ // / constraints other than normal aliasing. Volatile and atomic memory
177
+ // / operations can't be reordered.
184
178
// /
185
179
// / Currently, we don't model the difference between volatile and atomic
186
180
// / operations. They should retain their ordering relative to all memory
187
181
// / operations.
188
182
bool isUnordered () const { return !isVolatile (); }
189
183
190
- // / refineAlignment - Update this MachineMemOperand to reflect the alignment
191
- // / of MMO, if it has a greater alignment. This must only be used when the
192
- // / new alignment applies to all users of this MachineMemOperand.
184
+ // / Update this MachineMemOperand to reflect the alignment of MMO, if it has a
185
+ // / greater alignment. This must only be used when the new alignment applies
186
+ // / to all users of this MachineMemOperand.
193
187
void refineAlignment (const MachineMemOperand *MMO);
194
188
195
- // / setValue - Change the SourceValue for this MachineMemOperand. This
196
- // / should only be used when an object is being relocated and all references
197
- // / to it are being updated.
189
+ // / Change the SourceValue for this MachineMemOperand. This should only be
190
+ // / used when an object is being relocated and all references to it are being
191
+ // / updated.
198
192
void setValue (const Value *NewSV) { PtrInfo.V = NewSV; }
199
193
void setValue (const PseudoSourceValue *NewSV) { PtrInfo.V = NewSV; }
200
194
void setOffset (int64_t NewOffset) { PtrInfo.Offset = NewOffset; }
0 commit comments