jacquesguan created this revision. jacquesguan added reviewers: DavidTruby, efriedma, peterwaller-arm, paulwalker-arm, bsmith, c-rhodes, sdesmalen, rsandifo-arm, ctetreau, cameron.mcinally, aaron.ballman. Herald added a subscriber: psnobl. Herald added a project: All. jacquesguan requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Since we also have VLST for rvv now, it is not clear to keep using `isVLSTBuiltinType`, so I added prefix SVE to it. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D158045 Files: clang/include/clang/AST/Type.h clang/lib/AST/ASTContext.cpp clang/lib/AST/ExprConstant.cpp clang/lib/AST/Type.cpp clang/lib/CodeGen/CGExprScalar.cpp clang/lib/Sema/SemaChecking.cpp clang/lib/Sema/SemaExprCXX.cpp clang/lib/Sema/SemaType.cpp
Index: clang/lib/Sema/SemaType.cpp =================================================================== --- clang/lib/Sema/SemaType.cpp +++ clang/lib/Sema/SemaType.cpp @@ -8363,7 +8363,7 @@ } // Attribute can only be attached to a single SVE vector or predicate type. - if (!CurType->isVLSTBuiltinType()) { + if (!CurType->isSVEVLSTBuiltinType()) { S.Diag(Attr.getLoc(), diag::err_attribute_invalid_sve_type) << Attr << CurType; Attr.setInvalid(); Index: clang/lib/Sema/SemaExprCXX.cpp =================================================================== --- clang/lib/Sema/SemaExprCXX.cpp +++ clang/lib/Sema/SemaExprCXX.cpp @@ -6305,7 +6305,7 @@ static bool isValidSizelessVectorForConditionalCondition(ASTContext &Ctx, QualType CondTy) { - if (!CondTy->isVLSTBuiltinType()) + if (!CondTy->isSVEVLSTBuiltinType()) return false; const QualType EltTy = cast<BuiltinType>(CondTy.getCanonicalType())->getSveEltType(Ctx); @@ -6417,10 +6417,10 @@ QualType LHSType = LHS.get()->getType(); const auto *LHSBT = - LHSType->isVLSTBuiltinType() ? LHSType->getAs<BuiltinType>() : nullptr; + LHSType->isSVEVLSTBuiltinType() ? LHSType->getAs<BuiltinType>() : nullptr; QualType RHSType = RHS.get()->getType(); const auto *RHSBT = - RHSType->isVLSTBuiltinType() ? RHSType->getAs<BuiltinType>() : nullptr; + RHSType->isSVEVLSTBuiltinType() ? RHSType->getAs<BuiltinType>() : nullptr; QualType ResultType; @@ -6462,7 +6462,7 @@ RHS = ImpCastExprToType(RHS.get(), ResultType, CK_VectorSplat); } - assert(!ResultType.isNull() && ResultType->isVLSTBuiltinType() && + assert(!ResultType.isNull() && ResultType->isSVEVLSTBuiltinType() && "Result should have been a vector type"); auto *ResultBuiltinTy = ResultType->castAs<BuiltinType>(); QualType ResultElementTy = ResultBuiltinTy->getSveEltType(Context); Index: clang/lib/Sema/SemaChecking.cpp =================================================================== --- clang/lib/Sema/SemaChecking.cpp +++ clang/lib/Sema/SemaChecking.cpp @@ -14827,7 +14827,7 @@ // Strip vector types. if (isa<VectorType>(Source)) { - if (Target->isVLSTBuiltinType() && + if (Target->isSVEVLSTBuiltinType() && (S.Context.areCompatibleSveTypes(QualType(Target, 0), QualType(Source, 0)) || S.Context.areLaxCompatibleSveTypes(QualType(Target, 0), @@ -14878,7 +14878,7 @@ const BuiltinType *TargetBT = dyn_cast<BuiltinType>(Target); // Strip SVE vector types - if (SourceBT && SourceBT->isVLSTBuiltinType()) { + if (SourceBT && SourceBT->isSVEVLSTBuiltinType()) { // Need the original target type for vector type checks const Type *OriginalTarget = S.Context.getCanonicalType(T).getTypePtr(); // Handle conversion from scalable to fixed when msve-vector-bits is @@ -14897,7 +14897,7 @@ Source = SourceBT->getSveEltType(S.Context).getTypePtr(); } - if (TargetBT && TargetBT->isVLSTBuiltinType()) + if (TargetBT && TargetBT->isSVEVLSTBuiltinType()) Target = TargetBT->getSveEltType(S.Context).getTypePtr(); // If the source is floating point... Index: clang/lib/CodeGen/CGExprScalar.cpp =================================================================== --- clang/lib/CodeGen/CGExprScalar.cpp +++ clang/lib/CodeGen/CGExprScalar.cpp @@ -1798,7 +1798,7 @@ // careful, because the base of a vector subscript is occasionally an rvalue, // so we can't get it as an lvalue. if (!E->getBase()->getType()->isVectorType() && - !E->getBase()->getType()->isVLSTBuiltinType()) + !E->getBase()->getType()->isSVEVLSTBuiltinType()) return EmitLoadOfLValue(E); // Handle the vector case. The base must be a vector, the index must be an @@ -4858,7 +4858,7 @@ } if (condExpr->getType()->isVectorType() || - condExpr->getType()->isVLSTBuiltinType()) { + condExpr->getType()->isSVEVLSTBuiltinType()) { CGF.incrementProfileCounter(E); llvm::Value *CondV = CGF.EmitScalarExpr(condExpr); Index: clang/lib/AST/Type.cpp =================================================================== --- clang/lib/AST/Type.cpp +++ clang/lib/AST/Type.cpp @@ -1943,7 +1943,7 @@ bool Type::hasIntegerRepresentation() const { if (const auto *VT = dyn_cast<VectorType>(CanonicalType)) return VT->getElementType()->isIntegerType(); - if (CanonicalType->isVLSTBuiltinType()) { + if (CanonicalType->isSVEVLSTBuiltinType()) { const auto *VT = cast<BuiltinType>(CanonicalType); return VT->getKind() == BuiltinType::SveBool || (VT->getKind() >= BuiltinType::SveInt8 && @@ -2160,7 +2160,7 @@ return VT->getElementType()->isUnsignedIntegerOrEnumerationType(); if (const auto *VT = dyn_cast<MatrixType>(CanonicalType)) return VT->getElementType()->isUnsignedIntegerOrEnumerationType(); - if (CanonicalType->isVLSTBuiltinType()) { + if (CanonicalType->isSVEVLSTBuiltinType()) { const auto *VT = cast<BuiltinType>(CanonicalType); return VT->getKind() >= BuiltinType::SveUint8 && VT->getKind() <= BuiltinType::SveUint64; @@ -2414,7 +2414,7 @@ return false; } -bool Type::isVLSTBuiltinType() const { +bool Type::isSVEVLSTBuiltinType() const { if (const BuiltinType *BT = getAs<BuiltinType>()) { switch (BT->getKind()) { case BuiltinType::SveInt8: @@ -2441,7 +2441,7 @@ } QualType Type::getSveEltType(const ASTContext &Ctx) const { - assert(isVLSTBuiltinType() && "unsupported type!"); + assert(isSVEVLSTBuiltinType() && "unsupported type!"); const BuiltinType *BTy = castAs<BuiltinType>(); if (BTy->getKind() == BuiltinType::SveBool) Index: clang/lib/AST/ExprConstant.cpp =================================================================== --- clang/lib/AST/ExprConstant.cpp +++ clang/lib/AST/ExprConstant.cpp @@ -8569,7 +8569,7 @@ bool LValueExprEvaluator::VisitArraySubscriptExpr(const ArraySubscriptExpr *E) { // FIXME: Deal with vectors as array subscript bases. if (E->getBase()->getType()->isVectorType() || - E->getBase()->getType()->isVLSTBuiltinType()) + E->getBase()->getType()->isSVEVLSTBuiltinType()) return Error(E); APSInt Index; Index: clang/lib/AST/ASTContext.cpp =================================================================== --- clang/lib/AST/ASTContext.cpp +++ clang/lib/AST/ASTContext.cpp @@ -9461,7 +9461,7 @@ /// getSVETypeSize - Return SVE vector or predicate register size. static uint64_t getSVETypeSize(ASTContext &Context, const BuiltinType *Ty) { - assert(Ty->isVLSTBuiltinType() && "Invalid SVE Type"); + assert(Ty->isSVEVLSTBuiltinType() && "Invalid SVE Type"); if (Ty->getKind() == BuiltinType::SveBool || Ty->getKind() == BuiltinType::SveCount) return (Context.getLangOpts().VScaleMin * 128) / Context.getCharWidth(); Index: clang/include/clang/AST/Type.h =================================================================== --- clang/include/clang/AST/Type.h +++ clang/include/clang/AST/Type.h @@ -2055,7 +2055,7 @@ /// Determines if this is a sizeless type supported by the /// 'arm_sve_vector_bits' type attribute, which can be applied to a single /// SVE vector or predicate, excluding tuple types such as svint32x4_t. - bool isVLSTBuiltinType() const; + bool isSVEVLSTBuiltinType() const; /// Returns the representative type for the element of an SVE builtin type. /// This is used to represent fixed-length SVE vectors created with the
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits