@@ -45,6 +45,14 @@ class LLT {
45
45
/* AddressSpace=*/ 0 };
46
46
}
47
47
48
+ // / Get a low-level token; just a scalar with zero bits (or no size).
49
+ static constexpr LLT token () {
50
+ return LLT{/* isPointer=*/ false , /* isVector=*/ false ,
51
+ /* isScalar=*/ true , ElementCount::getFixed (0 ),
52
+ /* SizeInBits=*/ 0 ,
53
+ /* AddressSpace=*/ 0 };
54
+ }
55
+
48
56
// / Get a low-level pointer in the given address space.
49
57
static constexpr LLT pointer (unsigned AddressSpace, unsigned SizeInBits) {
50
58
assert (SizeInBits > 0 && " invalid pointer size" );
@@ -134,17 +142,17 @@ class LLT {
134
142
135
143
explicit LLT (MVT VT);
136
144
137
- constexpr bool isValid () const { return IsScalar || IsPointer || IsVector; }
138
-
145
+ constexpr bool isValid () const { return IsScalar || RawData != 0 ; }
139
146
constexpr bool isScalar () const { return IsScalar; }
140
-
141
- constexpr bool isPointer () const { return IsPointer && !IsVector; }
142
-
143
- constexpr bool isPointerVector () const { return IsPointer && IsVector; }
144
-
145
- constexpr bool isPointerOrPointerVector () const { return IsPointer; }
146
-
147
- constexpr bool isVector () const { return IsVector; }
147
+ constexpr bool isToken () const { return IsScalar && RawData == 0 ; };
148
+ constexpr bool isVector () const { return isValid () && IsVector; }
149
+ constexpr bool isPointer () const {
150
+ return isValid () && IsPointer && !IsVector;
151
+ }
152
+ constexpr bool isPointerVector () const { return IsPointer && isVector (); }
153
+ constexpr bool isPointerOrPointerVector () const {
154
+ return IsPointer && isValid ();
155
+ }
148
156
149
157
// / Returns the number of elements in a vector LLT. Must only be called on
150
158
// / vector types.
@@ -314,6 +322,28 @@ class LLT {
314
322
// / described in static const *Field variables. Each of these variables
315
323
// / is a 2-element array, with the first element describing the bitfield size
316
324
// / and the second element describing the bitfield offset.
325
+ // /
326
+ // / +--------+---------+--------+----------+----------------------+
327
+ // / |isScalar|isPointer|isVector| RawData |Notes |
328
+ // / +--------+---------+--------+----------+----------------------+
329
+ // / | 0 | 0 | 0 | 0 |Invalid |
330
+ // / +--------+---------+--------+----------+----------------------+
331
+ // / | 0 | 0 | 1 | 0 |Tombstone Key |
332
+ // / +--------+---------+--------+----------+----------------------+
333
+ // / | 0 | 1 | 0 | 0 |Empty Key |
334
+ // / +--------+---------+--------+----------+----------------------+
335
+ // / | 1 | 0 | 0 | 0 |Token |
336
+ // / +--------+---------+--------+----------+----------------------+
337
+ // / | 1 | 0 | 0 | non-zero |Scalar |
338
+ // / +--------+---------+--------+----------+----------------------+
339
+ // / | 0 | 1 | 0 | non-zero |Pointer |
340
+ // / +--------+---------+--------+----------+----------------------+
341
+ // / | 0 | 0 | 1 | non-zero |Vector of non-pointer |
342
+ // / +--------+---------+--------+----------+----------------------+
343
+ // / | 0 | 1 | 1 | non-zero |Vector of pointer |
344
+ // / +--------+---------+--------+----------+----------------------+
345
+ // /
346
+ // / Everything else is reserved.
317
347
typedef int BitFieldInfo[2 ];
318
348
// /
319
349
// / This is how the bitfields are packed per Kind:
0 commit comments