Skip to content

Commit 5f8aba8

Browse files
committed
[llvm][RISCV] Add RISCV vector tuple type to value types(MVT)
This patch handles the types(MVT) in `selectionDAG` for RISCV vector tuples. As described in previous patch handling llvm types, the MVTs also have 32 variants: ``` riscv_nxv1i8x2, riscv_nxv1i8x3, riscv_nxv1i8x4, riscv_nxv1i8x5, riscv_nxv1i8x6, riscv_nxv1i8x7, riscv_nxv1i8x8, riscv_nxv2i8x2, riscv_nxv2i8x3, riscv_nxv2i8x4, riscv_nxv2i8x5, riscv_nxv2i8x6, riscv_nxv2i8x7, riscv_nxv2i8x8, riscv_nxv4i8x2, riscv_nxv4i8x3, riscv_nxv4i8x4, riscv_nxv4i8x5, riscv_nxv4i8x6, riscv_nxv4i8x7, riscv_nxv4i8x8, riscv_nxv8i8x2, riscv_nxv8i8x3, riscv_nxv8i8x4, riscv_nxv8i8x5, riscv_nxv8i8x6, riscv_nxv8i8x7, riscv_nxv8i8x8, riscv_nxv16i8x2, riscv_nxv16i8x3, riscv_nxv16i8x4, riscv_nxv32i8x2. ``` An intuitive way to model vector tuple type is using nested scalable vector, e.g. `nElts=NF, EltTy=nxv2i32`. However it's not compatible to what we've done to handle scalable vector in TargetLowering, so it would need more effort to change the code to handle this concept. Another approach is encoding the `MinNumElts` info in `sz` of `MVT`, e.g. `nElts=NF, sz=(NF*MinNumElts*8)`, this makes it much easier to handle and changes less code. This patch adopts the latter approach.
1 parent 989ac51 commit 5f8aba8

File tree

6 files changed

+143
-26
lines changed

6 files changed

+143
-26
lines changed

llvm/include/llvm/CodeGen/ValueTypes.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ namespace llvm {
175175
return isSimple() ? V.isScalableVector() : isExtendedScalableVector();
176176
}
177177

178+
/// Return true if this is a vector value type.
179+
bool isRISCVVectorTuple() const { return V.isRISCVVectorTuple(); }
180+
178181
bool isFixedLengthVector() const {
179182
return isSimple() ? V.isFixedLengthVector()
180183
: isExtendedFixedLengthVector();
@@ -351,6 +354,11 @@ namespace llvm {
351354
return getVectorElementCount().getKnownMinValue();
352355
}
353356

357+
/// Given a RISCV vector tuple type, return the num_fields.
358+
unsigned getRISCVVectorTupleNumFields() const {
359+
return V.getRISCVVectorTupleNumFields();
360+
}
361+
354362
/// Return the size of the specified value type in bits.
355363
///
356364
/// If the value type is a scalable vector type, the scalable property will

llvm/include/llvm/CodeGen/ValueTypes.td

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class ValueType<int size, int value> {
2323
bit isFP = false;
2424
bit isVector = false;
2525
bit isScalable = false;
26+
int NF = 0;
27+
bit isRISCVVecTuple = false;
2628
// Indicates this VT should be included in the
2729
// [FIRST_VALUETYPE,LAST_VALUETYPE] range.
2830
bit isNormalValueType = true;
@@ -56,6 +58,13 @@ class VTScalableVec<int nelem, ValueType elt, int value>
5658
let isScalable = true;
5759
}
5860

61+
class VTVecTup<int size, int nf, ValueType dummy_elt, int value>
62+
: ValueType<size, value> {
63+
let NF = nf;
64+
let ElementType = dummy_elt;
65+
let isRISCVVecTuple = true;
66+
}
67+
5968
defset list<ValueType> ValueTypes = {
6069

6170
def OtherVT : ValueType<0, 1> { // "Other" value
@@ -273,20 +282,54 @@ def nxv2f64 : VTScalableVec<2, f64, 187>; // n x 2 x f64 vector value
273282
def nxv4f64 : VTScalableVec<4, f64, 188>; // n x 4 x f64 vector value
274283
def nxv8f64 : VTScalableVec<8, f64, 189>; // n x 8 x f64 vector value
275284

276-
def x86mmx : ValueType<64, 190>; // X86 MMX value
277-
def Glue : ValueType<0, 191>; // Pre-RA sched glue
278-
def isVoid : ValueType<0, 192>; // Produces no value
279-
def untyped : ValueType<8, 193> { // Produces an untyped value
285+
// Sz = NF * MinNumElts * 8(bits)
286+
def riscv_nxv1i8x2 : VTVecTup<16, 2, i8, 190>; // RISCV vector tuple(min_num_elts=1, nf=2)
287+
def riscv_nxv1i8x3 : VTVecTup<24, 3, i8, 191>; // RISCV vector tuple(min_num_elts=1, nf=3)
288+
def riscv_nxv1i8x4 : VTVecTup<32, 4, i8, 192>; // RISCV vector tuple(min_num_elts=1, nf=4)
289+
def riscv_nxv1i8x5 : VTVecTup<40, 5, i8, 193>; // RISCV vector tuple(min_num_elts=1, nf=5)
290+
def riscv_nxv1i8x6 : VTVecTup<48, 6, i8, 194>; // RISCV vector tuple(min_num_elts=1, nf=6)
291+
def riscv_nxv1i8x7 : VTVecTup<56, 7, i8, 195>; // RISCV vector tuple(min_num_elts=1, nf=7)
292+
def riscv_nxv1i8x8 : VTVecTup<64, 8, i8, 196>; // RISCV vector tuple(min_num_elts=1, nf=8)
293+
def riscv_nxv2i8x2 : VTVecTup<32, 2, i8, 197>; // RISCV vector tuple(min_num_elts=2, nf=2)
294+
def riscv_nxv2i8x3 : VTVecTup<48, 3, i8, 198>; // RISCV vector tuple(min_num_elts=2, nf=3)
295+
def riscv_nxv2i8x4 : VTVecTup<64, 4, i8, 199>; // RISCV vector tuple(min_num_elts=2, nf=4)
296+
def riscv_nxv2i8x5 : VTVecTup<80, 5, i8, 200>; // RISCV vector tuple(min_num_elts=2, nf=5)
297+
def riscv_nxv2i8x6 : VTVecTup<96, 6, i8, 201>; // RISCV vector tuple(min_num_elts=2, nf=6)
298+
def riscv_nxv2i8x7 : VTVecTup<112, 7, i8, 202>; // RISCV vector tuple(min_num_elts=2, nf=7)
299+
def riscv_nxv2i8x8 : VTVecTup<128, 8, i8, 203>; // RISCV vector tuple(min_num_elts=2, nf=8)
300+
def riscv_nxv4i8x2 : VTVecTup<64, 2, i8, 204>; // RISCV vector tuple(min_num_elts=4, nf=2)
301+
def riscv_nxv4i8x3 : VTVecTup<96, 3, i8, 205>; // RISCV vector tuple(min_num_elts=4, nf=3)
302+
def riscv_nxv4i8x4 : VTVecTup<128, 4, i8, 206>; // RISCV vector tuple(min_num_elts=4, nf=4)
303+
def riscv_nxv4i8x5 : VTVecTup<160, 5, i8, 207>; // RISCV vector tuple(min_num_elts=4, nf=5)
304+
def riscv_nxv4i8x6 : VTVecTup<192, 6, i8, 208>; // RISCV vector tuple(min_num_elts=4, nf=6)
305+
def riscv_nxv4i8x7 : VTVecTup<224, 7, i8, 209>; // RISCV vector tuple(min_num_elts=4, nf=7)
306+
def riscv_nxv4i8x8 : VTVecTup<256, 8, i8, 210>; // RISCV vector tuple(min_num_elts=4, nf=8)
307+
def riscv_nxv8i8x2 : VTVecTup<128, 2, i8, 211>; // RISCV vector tuple(min_num_elts=8, nf=2)
308+
def riscv_nxv8i8x3 : VTVecTup<192, 3, i8, 212>; // RISCV vector tuple(min_num_elts=8, nf=3)
309+
def riscv_nxv8i8x4 : VTVecTup<256, 4, i8, 213>; // RISCV vector tuple(min_num_elts=8, nf=4)
310+
def riscv_nxv8i8x5 : VTVecTup<320, 5, i8, 214>; // RISCV vector tuple(min_num_elts=8, nf=5)
311+
def riscv_nxv8i8x6 : VTVecTup<384, 6, i8, 215>; // RISCV vector tuple(min_num_elts=8, nf=6)
312+
def riscv_nxv8i8x7 : VTVecTup<448, 7, i8, 216>; // RISCV vector tuple(min_num_elts=8, nf=7)
313+
def riscv_nxv8i8x8 : VTVecTup<512, 8, i8, 217>; // RISCV vector tuple(min_num_elts=8, nf=8)
314+
def riscv_nxv16i8x2 : VTVecTup<256, 2, i8, 218>; // RISCV vector tuple(min_num_elts=16, nf=2)
315+
def riscv_nxv16i8x3 : VTVecTup<384, 3, i8, 219>; // RISCV vector tuple(min_num_elts=16, nf=3)
316+
def riscv_nxv16i8x4 : VTVecTup<512, 4, i8, 220>; // RISCV vector tuple(min_num_elts=16, nf=4)
317+
def riscv_nxv32i8x2 : VTVecTup<512, 2, i8, 221>; // RISCV vector tuple(min_num_elts=32, nf=2)
318+
319+
def x86mmx : ValueType<64, 222>; // X86 MMX value
320+
def Glue : ValueType<0, 223>; // Pre-RA sched glue
321+
def isVoid : ValueType<0, 224>; // Produces no value
322+
def untyped : ValueType<8, 225> { // Produces an untyped value
280323
let LLVMName = "Untyped";
281324
}
282-
def funcref : ValueType<0, 194>; // WebAssembly's funcref type
283-
def externref : ValueType<0, 195>; // WebAssembly's externref type
284-
def exnref : ValueType<0, 196>; // WebAssembly's exnref type
285-
def x86amx : ValueType<8192, 197>; // X86 AMX value
286-
def i64x8 : ValueType<512, 198>; // 8 Consecutive GPRs (AArch64)
325+
def funcref : ValueType<0, 226>; // WebAssembly's funcref type
326+
def externref : ValueType<0, 227>; // WebAssembly's externref type
327+
def exnref : ValueType<0, 228>; // WebAssembly's exnref type
328+
def x86amx : ValueType<8192, 229>; // X86 AMX value
329+
def i64x8 : ValueType<512, 230>; // 8 Consecutive GPRs (AArch64)
287330
def aarch64svcount
288-
: ValueType<16, 199>; // AArch64 predicate-as-counter
289-
def spirvbuiltin : ValueType<0, 200>; // SPIR-V's builtin type
331+
: ValueType<16, 231>; // AArch64 predicate-as-counter
332+
def spirvbuiltin : ValueType<0, 232>; // SPIR-V's builtin type
290333

291334
let isNormalValueType = false in {
292335
def token : ValueType<0, 504>; // TokenTy

llvm/include/llvm/CodeGenTypes/MachineValueType.h

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ namespace llvm {
3939
// are considered extended value types.
4040
INVALID_SIMPLE_VALUE_TYPE = 0,
4141

42-
#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, NElem, EltTy) Ty = n,
42+
#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
43+
Ty = n,
4344
#define GET_VT_RANGES
4445
#include "llvm/CodeGen/GenVT.inc"
4546
#undef GET_VT_ATTR
@@ -114,6 +115,13 @@ namespace llvm {
114115
SimpleTy <= MVT::LAST_SCALABLE_VECTOR_VALUETYPE);
115116
}
116117

118+
/// Return true if this is a RISCV vector tuple type where the
119+
/// runtime length is machine dependent
120+
bool isRISCVVectorTuple() const {
121+
return (SimpleTy >= MVT::FIRST_RISCV_VECTOR_TUPLE_VALUETYPE &&
122+
SimpleTy <= MVT::LAST_RISCV_VECTOR_TUPLE_VALUETYPE);
123+
}
124+
117125
/// Return true if this is a custom target type that has a scalable size.
118126
bool isScalableTargetExtVT() const {
119127
return SimpleTy == MVT::aarch64svcount;
@@ -172,7 +180,7 @@ namespace llvm {
172180
/// Return true if this is an overloaded type for TableGen.
173181
bool isOverloaded() const {
174182
switch (SimpleTy) {
175-
#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
183+
#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
176184
case Ty: \
177185
return Any;
178186
#include "llvm/CodeGen/GenVT.inc"
@@ -255,7 +263,8 @@ namespace llvm {
255263
MVT getVectorElementType() const {
256264
assert(SimpleTy >= FIRST_VALUETYPE && SimpleTy <= LAST_VALUETYPE);
257265
static constexpr SimpleValueType EltTyTable[] = {
258-
#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, NElem, EltTy) EltTy,
266+
#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
267+
EltTy,
259268
#include "llvm/CodeGen/GenVT.inc"
260269
#undef GET_VT_ATTR
261270
};
@@ -268,7 +277,8 @@ namespace llvm {
268277
unsigned getVectorMinNumElements() const {
269278
assert(SimpleTy >= FIRST_VALUETYPE && SimpleTy <= LAST_VALUETYPE);
270279
static constexpr uint16_t NElemTable[] = {
271-
#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, NElem, EltTy) NElem,
280+
#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
281+
NElem,
272282
#include "llvm/CodeGen/GenVT.inc"
273283
#undef GET_VT_ATTR
274284
};
@@ -297,7 +307,7 @@ namespace llvm {
297307
/// base size.
298308
TypeSize getSizeInBits() const {
299309
static constexpr TypeSize SizeTable[] = {
300-
#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
310+
#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
301311
TypeSize(Sz, Sc || Ty == aarch64svcount /* FIXME: Not in the td. */),
302312
#include "llvm/CodeGen/GenVT.inc"
303313
#undef GET_VT_ATTR
@@ -419,7 +429,7 @@ namespace llvm {
419429
}
420430

421431
static MVT getFloatingPointVT(unsigned BitWidth) {
422-
#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
432+
#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
423433
if (FP == 3 && sz == BitWidth) \
424434
return Ty;
425435
#include "llvm/CodeGen/GenVT.inc"
@@ -429,7 +439,7 @@ namespace llvm {
429439
}
430440

431441
static MVT getIntegerVT(unsigned BitWidth) {
432-
#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
442+
#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
433443
if (Int == 3 && sz == BitWidth) \
434444
return Ty;
435445
#include "llvm/CodeGen/GenVT.inc"
@@ -439,8 +449,8 @@ namespace llvm {
439449
}
440450

441451
static MVT getVectorVT(MVT VT, unsigned NumElements) {
442-
#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy) \
443-
if (!Sc && VT.SimpleTy == ElTy && NumElements == nElem) \
452+
#define GET_VT_VECATTR(Ty, Sc, Tup, nElem, ElTy) \
453+
if (!Sc && !Tup && VT.SimpleTy == ElTy && NumElements == nElem) \
444454
return Ty;
445455
#include "llvm/CodeGen/GenVT.inc"
446456
#undef GET_VT_VECATTR
@@ -449,7 +459,7 @@ namespace llvm {
449459
}
450460

451461
static MVT getScalableVectorVT(MVT VT, unsigned NumElements) {
452-
#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy) \
462+
#define GET_VT_VECATTR(Ty, Sc, Tup, nElem, ElTy) \
453463
if (Sc && VT.SimpleTy == ElTy && NumElements == nElem) \
454464
return Ty;
455465
#include "llvm/CodeGen/GenVT.inc"
@@ -458,6 +468,29 @@ namespace llvm {
458468
return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
459469
}
460470

471+
static MVT getRISCVVectorTupleVT(unsigned Sz, unsigned NFields) {
472+
#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, Tup, NF, nElem, EltTy) \
473+
if (Tup && sz == Sz && NF == NFields) \
474+
return Ty;
475+
#include "llvm/CodeGen/GenVT.inc"
476+
#undef GET_VT_ATTR
477+
478+
llvm_unreachable("Invalid RISCV vector tuple type");
479+
}
480+
481+
/// Given a RISC-V vector tuple type, return the num_fields.
482+
unsigned getRISCVVectorTupleNumFields() const {
483+
assert(isRISCVVectorTuple() && SimpleTy >= FIRST_VALUETYPE &&
484+
SimpleTy <= LAST_VALUETYPE);
485+
static constexpr uint8_t NFTable[] = {
486+
#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
487+
NF,
488+
#include "llvm/CodeGen/GenVT.inc"
489+
#undef GET_VT_ATTR
490+
};
491+
return NFTable[SimpleTy - FIRST_VALUETYPE];
492+
}
493+
461494
static MVT getVectorVT(MVT VT, unsigned NumElements, bool IsScalable) {
462495
if (IsScalable)
463496
return getScalableVectorVT(VT, NumElements);

llvm/lib/CodeGen/ValueTypes.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ TypeSize EVT::getExtendedSizeInBits() const {
162162
std::string EVT::getEVTString() const {
163163
switch (V.SimpleTy) {
164164
default:
165+
if (isRISCVVectorTuple()) {
166+
unsigned Sz = getSizeInBits();
167+
unsigned NF = getRISCVVectorTupleNumFields();
168+
unsigned MinNumElts = Sz / (NF * 8);
169+
return "riscv_nxv" + utostr(MinNumElts) + "i8x" + utostr(NF);
170+
}
165171
if (isVector())
166172
return (isScalableVector() ? "nxv" : "v") +
167173
utostr(getVectorElementCount().getKnownMinValue()) +
@@ -250,6 +256,14 @@ MVT MVT::getVT(Type *Ty, bool HandleUnknown){
250256
return MVT(MVT::aarch64svcount);
251257
else if (TargetExtTy->getName().starts_with("spirv."))
252258
return MVT(MVT::spirvbuiltin);
259+
if (TargetExtTy->getName() == "riscv.vector.tuple") {
260+
unsigned Sz = cast<ScalableVectorType>(TargetExtTy->getTypeParameter(0))
261+
->getMinNumElements() *
262+
8;
263+
unsigned NF = TargetExtTy->getIntParameter(0);
264+
265+
return MVT::getRISCVVectorTupleVT(Sz * NF, NF);
266+
}
253267
if (HandleUnknown)
254268
return MVT(MVT::Other);
255269
llvm_unreachable("Unknown target ext type!");

llvm/utils/TableGen/Common/CodeGenTarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ StringRef llvm::getName(MVT::SimpleValueType T) {
6363
StringRef llvm::getEnumName(MVT::SimpleValueType T) {
6464
// clang-format off
6565
switch (T) {
66-
#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
66+
#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
6767
case MVT::Ty: return "MVT::" # Ty;
6868
#include "llvm/CodeGen/GenVT.inc"
6969
default: llvm_unreachable("ILLEGAL VALUE TYPE!");

llvm/utils/TableGen/VTEmitter.cpp

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ class VTEmitter {
3131

3232
static void VTtoGetLLVMTyString(raw_ostream &OS, const Record *VT) {
3333
bool IsVector = VT->getValueAsBit("isVector");
34+
bool IsRISCVVecTuple = VT->getValueAsBit("isRISCVVecTuple");
35+
36+
if (IsRISCVVecTuple) {
37+
unsigned NElem = VT->getValueAsInt("nElem");
38+
unsigned Sz = VT->getValueAsInt("Size");
39+
OS << "TargetExtType::get(Context, \"riscv.vector.tuple\", "
40+
"ScalableVectorType::get(Type::getInt8Ty(Context), "
41+
<< (Sz / (NElem * 8)) << "), " << NElem << ")";
42+
return;
43+
}
44+
3445
if (IsVector)
3546
OS << (VT->getValueAsBit("isScalable") ? "Scalable" : "Fixed")
3647
<< "VectorType::get(";
@@ -109,7 +120,7 @@ void VTEmitter::run(raw_ostream &OS) {
109120
}
110121
};
111122

112-
OS << "#ifdef GET_VT_ATTR // (Ty, n, sz, Any, Int, FP, Vec, Sc)\n";
123+
OS << "#ifdef GET_VT_ATTR // (Ty, n, sz, Any, Int, FP, Vec, Sc, Tup, NF)\n";
113124
for (const auto *VT : VTsByNumber) {
114125
if (!VT)
115126
continue;
@@ -119,6 +130,8 @@ void VTEmitter::run(raw_ostream &OS) {
119130
bool IsFP = VT->getValueAsBit("isFP");
120131
bool IsVector = VT->getValueAsBit("isVector");
121132
bool IsScalable = VT->getValueAsBit("isScalable");
133+
bool IsRISCVVecTuple = VT->getValueAsBit("isRISCVVecTuple");
134+
int64_t NF = VT->getValueAsInt("NF");
122135
bool IsNormalValueType = VT->getValueAsBit("isNormalValueType");
123136
int64_t NElem = IsVector ? VT->getValueAsInt("nElem") : 0;
124137
StringRef EltName = IsVector ? VT->getValueAsDef("ElementType")->getName()
@@ -131,8 +144,10 @@ void VTEmitter::run(raw_ostream &OS) {
131144
UpdateVTRange("FP_FIXEDLEN_VECTOR_VALUETYPE", Name,
132145
IsFP && IsVector && !IsScalable);
133146
UpdateVTRange("FP_SCALABLE_VECTOR_VALUETYPE", Name, IsFP && IsScalable);
134-
UpdateVTRange("FIXEDLEN_VECTOR_VALUETYPE", Name, IsVector && !IsScalable);
147+
UpdateVTRange("FIXEDLEN_VECTOR_VALUETYPE", Name,
148+
IsVector && !IsScalable);
135149
UpdateVTRange("SCALABLE_VECTOR_VALUETYPE", Name, IsScalable);
150+
UpdateVTRange("RISCV_VECTOR_TUPLE_VALUETYPE", Name, IsRISCVVecTuple);
136151
UpdateVTRange("VECTOR_VALUETYPE", Name, IsVector);
137152
UpdateVTRange("INTEGER_VALUETYPE", Name, IsInteger && !IsVector);
138153
UpdateVTRange("FP_VALUETYPE", Name, IsFP && !IsVector);
@@ -148,6 +163,8 @@ void VTEmitter::run(raw_ostream &OS) {
148163
<< (IsFP ? Name[0] == 'f' ? 3 : 1 : 0) << ", "
149164
<< IsVector << ", "
150165
<< IsScalable << ", "
166+
<< IsRISCVVecTuple << ", "
167+
<< NF << ", "
151168
<< NElem << ", "
152169
<< EltName << ")\n";
153170
// clang-format on
@@ -162,7 +179,7 @@ void VTEmitter::run(raw_ostream &OS) {
162179
}
163180
OS << "#endif\n\n";
164181

165-
OS << "#ifdef GET_VT_VECATTR // (Ty, Sc, nElem, ElTy)\n";
182+
OS << "#ifdef GET_VT_VECATTR // (Ty, Sc, Tup, nElem, ElTy)\n";
166183
for (const auto *VT : VTsByNumber) {
167184
if (!VT || !VT->getValueAsBit("isVector"))
168185
continue;
@@ -172,6 +189,7 @@ void VTEmitter::run(raw_ostream &OS) {
172189
OS << " GET_VT_VECATTR("
173190
<< VT->getValueAsString("LLVMName") << ", "
174191
<< VT->getValueAsBit("isScalable") << ", "
192+
<< VT->getValueAsBit("isRISCVVecTuple") << ", "
175193
<< VT->getValueAsInt("nElem") << ", "
176194
<< ElTy->getName() << ")\n";
177195
// clang-format on
@@ -185,8 +203,9 @@ void VTEmitter::run(raw_ostream &OS) {
185203
bool IsInteger = VT->getValueAsBit("isInteger");
186204
bool IsVector = VT->getValueAsBit("isVector");
187205
bool IsFP = VT->getValueAsBit("isFP");
206+
bool IsRISCVVecTuple = VT->getValueAsBit("isRISCVVecTuple");
188207

189-
if (!IsInteger && !IsVector && !IsFP)
208+
if (!IsInteger && !IsVector && !IsFP && !IsRISCVVecTuple)
190209
continue;
191210

192211
OS << " GET_VT_EVT(" << VT->getValueAsString("LLVMName") << ", ";

0 commit comments

Comments
 (0)