@@ -1935,14 +1935,14 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const {
1935
1935
uint64_t TargetVectorAlign = Target->getMaxVectorAlign();
1936
1936
if (TargetVectorAlign && TargetVectorAlign < Align)
1937
1937
Align = TargetVectorAlign;
1938
- if (VT->getVectorKind() == VectorType::SveFixedLengthDataVector )
1938
+ if (VT->getVectorKind() == VectorKind::SveFixedLengthData )
1939
1939
// Adjust the alignment for fixed-length SVE vectors. This is important
1940
1940
// for non-power-of-2 vector lengths.
1941
1941
Align = 128;
1942
- else if (VT->getVectorKind() == VectorType::SveFixedLengthPredicateVector )
1942
+ else if (VT->getVectorKind() == VectorKind::SveFixedLengthPredicate )
1943
1943
// Adjust the alignment for fixed-length SVE predicates.
1944
1944
Align = 16;
1945
- else if (VT->getVectorKind() == VectorType::RVVFixedLengthDataVector )
1945
+ else if (VT->getVectorKind() == VectorKind::RVVFixedLengthData )
1946
1946
// Adjust the alignment for fixed-length RVV vectors.
1947
1947
Align = std::min<unsigned>(64, Width);
1948
1948
break;
@@ -4004,7 +4004,7 @@ QualType ASTContext::getScalableVectorType(QualType EltTy, unsigned NumElts,
4004
4004
/// getVectorType - Return the unique reference to a vector type of
4005
4005
/// the specified element type and size. VectorType must be a built-in type.
4006
4006
QualType ASTContext::getVectorType(QualType vecType, unsigned NumElts,
4007
- VectorType:: VectorKind VecKind) const {
4007
+ VectorKind VecKind) const {
4008
4008
assert(vecType->isBuiltinType() ||
4009
4009
(vecType->isBitIntType() &&
4010
4010
// Only support _BitInt elements with byte-sized power of 2 NumBits.
@@ -4036,10 +4036,9 @@ QualType ASTContext::getVectorType(QualType vecType, unsigned NumElts,
4036
4036
return QualType(New, 0);
4037
4037
}
4038
4038
4039
- QualType
4040
- ASTContext::getDependentVectorType(QualType VecType, Expr *SizeExpr,
4041
- SourceLocation AttrLoc,
4042
- VectorType::VectorKind VecKind) const {
4039
+ QualType ASTContext::getDependentVectorType(QualType VecType, Expr *SizeExpr,
4040
+ SourceLocation AttrLoc,
4041
+ VectorKind VecKind) const {
4043
4042
llvm::FoldingSetNodeID ID;
4044
4043
DependentVectorType::Profile(ID, *this, getCanonicalType(VecType), SizeExpr,
4045
4044
VecKind);
@@ -4088,7 +4087,7 @@ QualType ASTContext::getExtVectorType(QualType vecType,
4088
4087
// Check if we've already instantiated a vector of this type.
4089
4088
llvm::FoldingSetNodeID ID;
4090
4089
VectorType::Profile(ID, vecType, NumElts, Type::ExtVector,
4091
- VectorType::GenericVector );
4090
+ VectorKind::Generic );
4092
4091
void *InsertPos = nullptr;
4093
4092
if (VectorType *VTP = VectorTypes.FindNodeOrInsertPos(ID, InsertPos))
4094
4093
return QualType(VTP, 0);
@@ -9396,16 +9395,16 @@ bool ASTContext::areCompatibleVectorTypes(QualType FirstVec,
9396
9395
const auto *Second = SecondVec->castAs<VectorType>();
9397
9396
if (First->getNumElements() == Second->getNumElements() &&
9398
9397
hasSameType(First->getElementType(), Second->getElementType()) &&
9399
- First->getVectorKind() != VectorType ::AltiVecPixel &&
9400
- First->getVectorKind() != VectorType ::AltiVecBool &&
9401
- Second->getVectorKind() != VectorType ::AltiVecPixel &&
9402
- Second->getVectorKind() != VectorType ::AltiVecBool &&
9403
- First->getVectorKind() != VectorType::SveFixedLengthDataVector &&
9404
- First->getVectorKind() != VectorType::SveFixedLengthPredicateVector &&
9405
- Second->getVectorKind() != VectorType::SveFixedLengthDataVector &&
9406
- Second->getVectorKind() != VectorType::SveFixedLengthPredicateVector &&
9407
- First->getVectorKind() != VectorType::RVVFixedLengthDataVector &&
9408
- Second->getVectorKind() != VectorType::RVVFixedLengthDataVector )
9398
+ First->getVectorKind() != VectorKind ::AltiVecPixel &&
9399
+ First->getVectorKind() != VectorKind ::AltiVecBool &&
9400
+ Second->getVectorKind() != VectorKind ::AltiVecPixel &&
9401
+ Second->getVectorKind() != VectorKind ::AltiVecBool &&
9402
+ First->getVectorKind() != VectorKind::SveFixedLengthData &&
9403
+ First->getVectorKind() != VectorKind::SveFixedLengthPredicate &&
9404
+ Second->getVectorKind() != VectorKind::SveFixedLengthData &&
9405
+ Second->getVectorKind() != VectorKind::SveFixedLengthPredicate &&
9406
+ First->getVectorKind() != VectorKind::RVVFixedLengthData &&
9407
+ Second->getVectorKind() != VectorKind::RVVFixedLengthData )
9409
9408
return true;
9410
9409
9411
9410
return false;
@@ -9432,12 +9431,12 @@ bool ASTContext::areCompatibleSveTypes(QualType FirstType,
9432
9431
if (const auto *VT = SecondType->getAs<VectorType>()) {
9433
9432
// Predicates have the same representation as uint8 so we also have to
9434
9433
// check the kind to make these types incompatible.
9435
- if (VT->getVectorKind() == VectorType::SveFixedLengthPredicateVector )
9434
+ if (VT->getVectorKind() == VectorKind::SveFixedLengthPredicate )
9436
9435
return BT->getKind() == BuiltinType::SveBool;
9437
- else if (VT->getVectorKind() == VectorType::SveFixedLengthDataVector )
9436
+ else if (VT->getVectorKind() == VectorKind::SveFixedLengthData )
9438
9437
return VT->getElementType().getCanonicalType() ==
9439
9438
FirstType->getSveEltType(*this);
9440
- else if (VT->getVectorKind() == VectorType::GenericVector )
9439
+ else if (VT->getVectorKind() == VectorKind::Generic )
9441
9440
return getTypeSize(SecondType) == getSVETypeSize(*this, BT) &&
9442
9441
hasSameType(VT->getElementType(),
9443
9442
getBuiltinVectorTypeInfo(BT).ElementType);
@@ -9463,24 +9462,23 @@ bool ASTContext::areLaxCompatibleSveTypes(QualType FirstType,
9463
9462
return false;
9464
9463
9465
9464
const auto *VecTy = SecondType->getAs<VectorType>();
9466
- if (VecTy &&
9467
- (VecTy->getVectorKind() == VectorType::SveFixedLengthDataVector ||
9468
- VecTy->getVectorKind() == VectorType::GenericVector)) {
9465
+ if (VecTy && (VecTy->getVectorKind() == VectorKind::SveFixedLengthData ||
9466
+ VecTy->getVectorKind() == VectorKind::Generic)) {
9469
9467
const LangOptions::LaxVectorConversionKind LVCKind =
9470
9468
getLangOpts().getLaxVectorConversions();
9471
9469
9472
9470
// Can not convert between sve predicates and sve vectors because of
9473
9471
// different size.
9474
9472
if (BT->getKind() == BuiltinType::SveBool &&
9475
- VecTy->getVectorKind() == VectorType::SveFixedLengthDataVector )
9473
+ VecTy->getVectorKind() == VectorKind::SveFixedLengthData )
9476
9474
return false;
9477
9475
9478
9476
// If __ARM_FEATURE_SVE_BITS != N do not allow GNU vector lax conversion.
9479
9477
// "Whenever __ARM_FEATURE_SVE_BITS==N, GNUT implicitly
9480
9478
// converts to VLAT and VLAT implicitly converts to GNUT."
9481
9479
// ACLE Spec Version 00bet6, 3.7.3.2. Behavior common to vectors and
9482
9480
// predicates.
9483
- if (VecTy->getVectorKind() == VectorType::GenericVector &&
9481
+ if (VecTy->getVectorKind() == VectorKind::Generic &&
9484
9482
getTypeSize(SecondType) != getSVETypeSize(*this, BT))
9485
9483
return false;
9486
9484
@@ -9527,8 +9525,8 @@ bool ASTContext::areCompatibleRVVTypes(QualType FirstType,
9527
9525
auto IsValidCast = [this](QualType FirstType, QualType SecondType) {
9528
9526
if (const auto *BT = FirstType->getAs<BuiltinType>()) {
9529
9527
if (const auto *VT = SecondType->getAs<VectorType>()) {
9530
- if (VT->getVectorKind() == VectorType::RVVFixedLengthDataVector ||
9531
- VT->getVectorKind() == VectorType::GenericVector )
9528
+ if (VT->getVectorKind() == VectorKind::RVVFixedLengthData ||
9529
+ VT->getVectorKind() == VectorKind::Generic )
9532
9530
return FirstType->isRVVVLSBuiltinType() &&
9533
9531
getTypeSize(SecondType) == getRVVTypeSize(*this, BT) &&
9534
9532
hasSameType(VT->getElementType(),
@@ -9558,7 +9556,7 @@ bool ASTContext::areLaxCompatibleRVVTypes(QualType FirstType,
9558
9556
return false;
9559
9557
9560
9558
const auto *VecTy = SecondType->getAs<VectorType>();
9561
- if (VecTy && VecTy->getVectorKind() == VectorType::GenericVector ) {
9559
+ if (VecTy && VecTy->getVectorKind() == VectorKind::Generic ) {
9562
9560
const LangOptions::LaxVectorConversionKind LVCKind =
9563
9561
getLangOpts().getLaxVectorConversions();
9564
9562
@@ -11398,8 +11396,7 @@ static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context,
11398
11396
assert(!RequiresICE && "Can't require vector ICE");
11399
11397
11400
11398
// TODO: No way to make AltiVec vectors in builtins yet.
11401
- Type = Context.getVectorType(ElementType, NumElements,
11402
- VectorType::GenericVector);
11399
+ Type = Context.getVectorType(ElementType, NumElements, VectorKind::Generic);
11403
11400
break;
11404
11401
}
11405
11402
case 'E': {
0 commit comments