@@ -1423,9 +1423,18 @@ static uint64_t getSVETypeSize(ASTContext &Context, const BuiltinType *Ty,
14231423
14241424bool SemaARM::areCompatibleSveTypes (QualType FirstType, QualType SecondType) {
14251425 bool IsStreaming = false ;
1426- if (const FunctionDecl *FD = SemaRef.getCurFunctionDecl (/* AllowLambda=*/ true ))
1426+ if (const FunctionDecl *FD =
1427+ SemaRef.getCurFunctionDecl (/* AllowLambda=*/ true )) {
1428+ // For streaming-compatible functions, we don't know vector length.
1429+ if (const auto *T = FD->getType ()->getAs <FunctionProtoType>())
1430+ if (T->getAArch64SMEAttributes () &
1431+ FunctionType::SME_PStateSMCompatibleMask)
1432+ return false ;
1433+
14271434 if (IsArmStreamingFunction (FD, /* IncludeLocallyStreaming=*/ true ))
14281435 IsStreaming = true ;
1436+ }
1437+
14291438 auto IsValidCast = [&](QualType FirstType, QualType SecondType) {
14301439 if (const auto *BT = FirstType->getAs <BuiltinType>()) {
14311440 if (const auto *VT = SecondType->getAs <VectorType>()) {
@@ -1455,9 +1464,17 @@ bool SemaARM::areCompatibleSveTypes(QualType FirstType, QualType SecondType) {
14551464bool SemaARM::areLaxCompatibleSveTypes (QualType FirstType,
14561465 QualType SecondType) {
14571466 bool IsStreaming = false ;
1458- if (const FunctionDecl *FD = SemaRef.getCurFunctionDecl (/* AllowLambda=*/ true ))
1467+ if (const FunctionDecl *FD =
1468+ SemaRef.getCurFunctionDecl (/* AllowLambda=*/ true )) {
1469+ // For streaming-compatible functions, we don't know vector length.
1470+ if (const auto *T = FD->getType ()->getAs <FunctionProtoType>())
1471+ if (T->getAArch64SMEAttributes () &
1472+ FunctionType::SME_PStateSMCompatibleMask)
1473+ return false ;
1474+
14591475 if (IsArmStreamingFunction (FD, /* IncludeLocallyStreaming=*/ true ))
14601476 IsStreaming = true ;
1477+ }
14611478
14621479 auto IsLaxCompatible = [&](QualType FirstType, QualType SecondType) {
14631480 const auto *BT = FirstType->getAs <BuiltinType>();
0 commit comments