@@ -116,7 +116,7 @@ class SVEType {
116
116
117
117
unsigned getNumElements () const {
118
118
assert (ElementBitwidth != ~0U );
119
- return Bitwidth / ElementBitwidth;
119
+ return isPredicate () ? 16 : ( Bitwidth / ElementBitwidth) ;
120
120
}
121
121
unsigned getSizeInBits () const {
122
122
return Bitwidth;
@@ -137,7 +137,7 @@ class SVEType {
137
137
// / Applies a prototype modifier to the type.
138
138
void applyModifier (char Mod);
139
139
140
- // / Get the builtin base for this SVEType, e.g, 'Wi' for svint64_t.
140
+ // / Get the builtin base for this SVEType, e.g. 'Wi' for svint64_t.
141
141
std::string builtinBaseType () const ;
142
142
};
143
143
@@ -442,6 +442,11 @@ std::string SVEType::builtinBaseType() const {
442
442
return " v" ;
443
443
case TypeKind::Svcount:
444
444
return " Qa" ;
445
+ case TypeKind::PrefetchOp:
446
+ case TypeKind::PredicatePattern:
447
+ return " i" ;
448
+ case TypeKind::Predicate:
449
+ return " b" ;
445
450
case TypeKind::BFloat16:
446
451
assert (ElementBitwidth == 16 && " Invalid BFloat16!" );
447
452
return " y" ;
@@ -459,11 +464,8 @@ std::string SVEType::builtinBaseType() const {
459
464
default :
460
465
llvm_unreachable (" Unhandled float width!" );
461
466
}
462
- case TypeKind::Predicate:
463
- if (isScalar ())
464
- return " b" ;
465
- [[fallthrough]];
466
- // SInt/UInt, PredicatePattern, PrefetchOp.
467
+ case TypeKind::SInt:
468
+ case TypeKind::UInt:
467
469
default :
468
470
switch (ElementBitwidth) {
469
471
case 1 :
@@ -482,10 +484,10 @@ std::string SVEType::builtinBaseType() const {
482
484
llvm_unreachable (" Unhandled bitwidth!" );
483
485
}
484
486
}
487
+ llvm_unreachable (" Unhandled TypeKind!" );
485
488
}
486
489
487
490
std::string SVEType::builtin_str () const {
488
-
489
491
std::string Prefix;
490
492
491
493
if (isScalableVector ())
0 commit comments