@@ -1423,16 +1423,20 @@ 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 =
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 ;
1426+ if (LangOpts.VScaleMin != LangOpts.VScaleStreamingMin ||
1427+ LangOpts.VScaleMax != LangOpts.VScaleStreamingMax ) {
1428+ if (const FunctionDecl *FD =
1429+ SemaRef.getCurFunctionDecl (/* AllowLambda=*/ true )) {
1430+ // For streaming-compatible functions, we don't know vector length.
1431+ if (const auto *T = FD->getType ()->getAs <FunctionProtoType>()) {
1432+ if (T->getAArch64SMEAttributes () &
1433+ FunctionType::SME_PStateSMCompatibleMask)
1434+ return false ;
1435+ }
14331436
1434- if (IsArmStreamingFunction (FD, /* IncludeLocallyStreaming=*/ true ))
1435- IsStreaming = true ;
1437+ if (IsArmStreamingFunction (FD, /* IncludeLocallyStreaming=*/ true ))
1438+ IsStreaming = true ;
1439+ }
14361440 }
14371441
14381442 auto IsValidCast = [&](QualType FirstType, QualType SecondType) {
@@ -1464,16 +1468,19 @@ bool SemaARM::areCompatibleSveTypes(QualType FirstType, QualType SecondType) {
14641468bool SemaARM::areLaxCompatibleSveTypes (QualType FirstType,
14651469 QualType SecondType) {
14661470 bool IsStreaming = false ;
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-
1475- if (IsArmStreamingFunction (FD, /* IncludeLocallyStreaming=*/ true ))
1476- IsStreaming = true ;
1471+ if (LangOpts.VScaleMin != LangOpts.VScaleStreamingMin ||
1472+ LangOpts.VScaleMax != LangOpts.VScaleStreamingMax ) {
1473+ if (const FunctionDecl *FD =
1474+ SemaRef.getCurFunctionDecl (/* AllowLambda=*/ true )) {
1475+ // For streaming-compatible functions, we don't know vector length.
1476+ if (const auto *T = FD->getType ()->getAs <FunctionProtoType>())
1477+ if (T->getAArch64SMEAttributes () &
1478+ FunctionType::SME_PStateSMCompatibleMask)
1479+ return false ;
1480+
1481+ if (IsArmStreamingFunction (FD, /* IncludeLocallyStreaming=*/ true ))
1482+ IsStreaming = true ;
1483+ }
14771484 }
14781485
14791486 auto IsLaxCompatible = [&](QualType FirstType, QualType SecondType) {
0 commit comments