Skip to content
Merged
2 changes: 2 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,8 @@ Arm and AArch64 Support

- For AArch64, added support for generating executable-only code sections by using the
``-mexecute-only`` or ``-mpure-code`` compiler flags. (#GH125688)
- Added ``-msve-streaming-vector-bits=`` flag, which allows specifying the
SVE vector width in streaming mode.

Android Support
^^^^^^^^^^^^^^^
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -3317,6 +3317,9 @@ def err_sve_vector_in_non_sve_target : Error<
"SVE vector type %0 cannot be used in a target without sve">;
def err_sve_vector_in_non_streaming_function : Error<
"SVE vector type %0 cannot be used in a non-streaming function">;
def err_sve_fixed_vector_in_streaming_function
: Error<"fixed width SVE vector type %0 cannot be used in a "
"%select{streaming|streaming-compatible}1 function">;
def err_attribute_riscv_rvv_bits_unsupported : Error<
"%0 is only supported when '-mrvv-vector-bits=<bits>' is specified with a "
"value of \"zvl\" or a power 2 in the range [64,65536]">;
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Basic/LangOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,9 @@ LANGOPT(OmitVTableRTTI, 1, 0,
LANGOPT(VScaleMin, 32, 0, "Minimum vscale value")
LANGOPT(VScaleMax, 32, 0, "Maximum vscale value")

LANGOPT(VScaleStreamingMin, 32, 0, "Minimum streaming vscale value")
LANGOPT(VScaleStreamingMax, 32, 0, "Maximum streaming vscale value")

ENUM_LANGOPT(ExtendIntArgs, ExtendArgsKind, 1, ExtendArgsKind::ExtendTo32,
"Controls how scalar integer arguments are extended in calls "
"to unprototyped and varargs functions")
Expand Down
8 changes: 7 additions & 1 deletion clang/include/clang/Basic/TargetInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -1034,9 +1034,15 @@ class TargetInfo : public TransferrableTargetInfo,
/// set of primary and secondary targets.
virtual llvm::SmallVector<Builtin::InfosShard> getTargetBuiltins() const = 0;

enum class ArmStreamingKind {
NotStreaming,
StreamingCompatible,
Streaming,
};

/// Returns target-specific min and max values VScale_Range.
virtual std::optional<std::pair<unsigned, unsigned>>
getVScaleRange(const LangOptions &LangOpts, bool IsArmStreamingFunction,
getVScaleRange(const LangOptions &LangOpts, ArmStreamingKind Mode,
llvm::StringMap<bool> *FeatureMap = nullptr) const {
return std::nullopt;
}
Expand Down
19 changes: 19 additions & 0 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -5188,6 +5188,14 @@ def msve_vector_bits_EQ : Joined<["-"], "msve-vector-bits=">, Group<m_aarch64_Fe
Visibility<[ClangOption, FlangOption]>,
HelpText<"Specify the size in bits of an SVE vector register. Defaults to the"
" vector length agnostic value of \"scalable\". (AArch64 only)">;
def msve_streaming_vector_bits_EQ
: Joined<["-"], "msve-streaming-vector-bits=">,
Group<m_aarch64_Features_Group>,
Visibility<[ClangOption, FlangOption]>,
HelpText<
"Specify the size in bits of an SVE vector register in streaming "
"mode. Defaults to the vector length agnostic value of "
"\"scalable\". (AArch64 only)">;
} // let Flags = [TargetSpecific]

def mvscale_min_EQ : Joined<["-"], "mvscale-min=">,
Expand All @@ -5199,6 +5207,17 @@ def mvscale_max_EQ : Joined<["-"], "mvscale-max=">,
HelpText<"Specify the vscale maximum. Defaults to the"
" vector length agnostic value of \"0\". (AArch64/RISC-V only)">,
MarshallingInfoInt<LangOpts<"VScaleMax">>;
def mvscale_streaming_min_EQ
: Joined<["-"], "mvscale-streaming-min=">,
Visibility<[CC1Option, FC1Option]>,
HelpText<"Specify the vscale minimum. Defaults to \"1\". (AArch64 only)">,
MarshallingInfoInt<LangOpts<"VScaleStreamingMin">>;
def mvscale_streaming_max_EQ
: Joined<["-"], "mvscale-streaming-max=">,
Visibility<[CC1Option, FC1Option]>,
HelpText<"Specify the vscale maximum. Defaults to the"
" vector length agnostic value of \"0\". (AArch64 only)">,
MarshallingInfoInt<LangOpts<"VScaleStreamingMax">>;

def msign_return_address_EQ : Joined<["-"], "msign-return-address=">,
Visibility<[ClangOption, CC1Option]>,
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10513,8 +10513,8 @@ bool ASTContext::areCompatibleVectorTypes(QualType FirstVec,
/// getRVVTypeSize - Return RVV vector register size.
static uint64_t getRVVTypeSize(ASTContext &Context, const BuiltinType *Ty) {
assert(Ty->isRVVVLSBuiltinType() && "Invalid RVV Type");
auto VScale =
Context.getTargetInfo().getVScaleRange(Context.getLangOpts(), false);
auto VScale = Context.getTargetInfo().getVScaleRange(
Context.getLangOpts(), TargetInfo::ArmStreamingKind::NotStreaming);
if (!VScale)
return 0;

Expand Down
3 changes: 2 additions & 1 deletion clang/lib/AST/ItaniumMangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4273,7 +4273,8 @@ void CXXNameMangler::mangleRISCVFixedRVVVectorType(const VectorType *T) {

// Apend the LMUL suffix.
auto VScale = getASTContext().getTargetInfo().getVScaleRange(
getASTContext().getLangOpts(), false);
getASTContext().getLangOpts(),
TargetInfo::ArmStreamingKind::NotStreaming);
unsigned VLen = VScale->first * llvm::RISCV::RVVBitsPerBlock;

if (T->getVectorKind() == VectorKind::RVVFixedLengthData) {
Expand Down
28 changes: 24 additions & 4 deletions clang/lib/Basic/Targets/AArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,16 +823,36 @@ AArch64TargetInfo::getTargetBuiltins() const {

std::optional<std::pair<unsigned, unsigned>>
AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts,
bool IsArmStreamingFunction,
ArmStreamingKind Mode,
llvm::StringMap<bool> *FeatureMap) const {
if (LangOpts.VScaleMin || LangOpts.VScaleMax)
if (Mode == ArmStreamingKind::NotStreaming &&
(LangOpts.VScaleMin || LangOpts.VScaleMax))
return std::pair<unsigned, unsigned>(
LangOpts.VScaleMin ? LangOpts.VScaleMin : 1, LangOpts.VScaleMax);
LangOpts.VScaleMin ? LangOpts.VScaleMin : 1,
LangOpts.VScaleMax ? LangOpts.VScaleMax : 16);

if (Mode == ArmStreamingKind::Streaming &&
(LangOpts.VScaleStreamingMin || LangOpts.VScaleStreamingMax))
return std::pair<unsigned, unsigned>(
LangOpts.VScaleStreamingMin ? LangOpts.VScaleStreamingMin : 1,
LangOpts.VScaleStreamingMax ? LangOpts.VScaleStreamingMax : 16);

if (Mode == ArmStreamingKind::StreamingCompatible &&
((LangOpts.VScaleMin && LangOpts.VScaleStreamingMin) ||
(LangOpts.VScaleMax && LangOpts.VScaleStreamingMax))) {
unsigned Min =
std::min(LangOpts.VScaleMin ? LangOpts.VScaleMin : 1,
LangOpts.VScaleStreamingMin ? LangOpts.VScaleStreamingMin : 1);
unsigned Max = std::max(
LangOpts.VScaleMax ? LangOpts.VScaleMax : 16,
LangOpts.VScaleStreamingMax ? LangOpts.VScaleStreamingMax : 16);
return std::pair(Min, Max);
}

if (hasFeature("sve") || (FeatureMap && (FeatureMap->lookup("sve"))))
return std::pair<unsigned, unsigned>(1, 16);

if (IsArmStreamingFunction &&
if (Mode == ArmStreamingKind::Streaming &&
(hasFeature("sme") || (FeatureMap && (FeatureMap->lookup("sme")))))
return std::pair<unsigned, unsigned>(1, 16);

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Basic/Targets/AArch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
llvm::SmallVector<Builtin::InfosShard> getTargetBuiltins() const override;

std::optional<std::pair<unsigned, unsigned>>
getVScaleRange(const LangOptions &LangOpts, bool IsArmStreamingFunction,
getVScaleRange(const LangOptions &LangOpts, ArmStreamingKind Mode,
llvm::StringMap<bool> *FeatureMap = nullptr) const override;
bool doesFeatureAffectCodeGen(StringRef Name) const override;
bool validateCpuSupports(StringRef FeatureStr) const override;
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Basic/Targets/RISCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void RISCVTargetInfo::getTargetDefines(const LangOptions &Opts,
// Currently we support the v1.0 RISC-V V intrinsics.
Builder.defineMacro("__riscv_v_intrinsic", Twine(getVersionValue(1, 0)));

auto VScale = getVScaleRange(Opts, false);
auto VScale = getVScaleRange(Opts, ArmStreamingKind::NotStreaming);
if (VScale && VScale->first && VScale->first == VScale->second)
Builder.defineMacro("__riscv_v_fixed_vlen",
Twine(VScale->first * llvm::RISCV::RVVBitsPerBlock));
Expand Down Expand Up @@ -367,7 +367,7 @@ bool RISCVTargetInfo::initFeatureMap(

std::optional<std::pair<unsigned, unsigned>>
RISCVTargetInfo::getVScaleRange(const LangOptions &LangOpts,
bool IsArmStreamingFunction,
ArmStreamingKind IsArmStreamingFunction,
llvm::StringMap<bool> *FeatureMap) const {
// RISCV::RVVBitsPerBlock is 64.
unsigned VScaleMin = ISAInfo->getMinVLen() / llvm::RISCV::RVVBitsPerBlock;
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Basic/Targets/RISCV.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class RISCVTargetInfo : public TargetInfo {
const std::vector<std::string> &FeaturesVec) const override;

std::optional<std::pair<unsigned, unsigned>>
getVScaleRange(const LangOptions &LangOpts, bool IsArmStreamingFunction,
getVScaleRange(const LangOptions &LangOpts, ArmStreamingKind Mode,
llvm::StringMap<bool> *FeatureMap = nullptr) const override;

bool hasFeature(StringRef Feature) const override;
Expand Down
10 changes: 8 additions & 2 deletions clang/lib/CodeGen/CodeGenFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1109,10 +1109,16 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,

// Add vscale_range attribute if appropriate.
llvm::StringMap<bool> FeatureMap;
bool IsArmStreaming = false;
auto IsArmStreaming = TargetInfo::ArmStreamingKind::NotStreaming;
if (FD) {
getContext().getFunctionFeatureMap(FeatureMap, FD);
IsArmStreaming = IsArmStreamingFunction(FD, true);
if (const auto *T = FD->getType()->getAs<FunctionProtoType>())
if (T->getAArch64SMEAttributes() &
FunctionType::SME_PStateSMCompatibleMask)
IsArmStreaming = TargetInfo::ArmStreamingKind::StreamingCompatible;

if (IsArmStreamingFunction(FD, true))
IsArmStreaming = TargetInfo::ArmStreamingKind::Streaming;
}
std::optional<std::pair<unsigned, unsigned>> VScaleRange =
getContext().getTargetInfo().getVScaleRange(getLangOpts(), IsArmStreaming,
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/Targets/RISCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ ABIArgInfo RISCVABIInfo::coerceVLSVector(QualType Ty, unsigned ABIVLen) const {
assert(VT->getElementType()->isBuiltinType() && "expected builtin type!");

auto VScale = getContext().getTargetInfo().getVScaleRange(
getContext().getLangOpts(), false);
getContext().getLangOpts(), TargetInfo::ArmStreamingKind::NotStreaming);

unsigned NumElts = VT->getNumElements();
llvm::Type *EltType = llvm::Type::getInt1Ty(getVMContext());
Expand Down
26 changes: 18 additions & 8 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1668,30 +1668,40 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args,
}

// Handle -msve_vector_bits=<bits>
if (Arg *A = Args.getLastArg(options::OPT_msve_vector_bits_EQ)) {
auto HandleVectorBits = [&](Arg *A, StringRef VScaleMin,
StringRef VScaleMax) {
StringRef Val = A->getValue();
const Driver &D = getToolChain().getDriver();
if (Val == "128" || Val == "256" || Val == "512" || Val == "1024" ||
Val == "2048" || Val == "128+" || Val == "256+" || Val == "512+" ||
Val == "1024+" || Val == "2048+") {
unsigned Bits = 0;
if (!Val.consume_back("+")) {
bool Invalid = Val.getAsInteger(10, Bits); (void)Invalid;
bool Invalid = Val.getAsInteger(10, Bits);
(void)Invalid;
assert(!Invalid && "Failed to parse value");
CmdArgs.push_back(
Args.MakeArgString("-mvscale-max=" + llvm::Twine(Bits / 128)));
Args.MakeArgString(VScaleMax + llvm::Twine(Bits / 128)));
}

bool Invalid = Val.getAsInteger(10, Bits); (void)Invalid;
bool Invalid = Val.getAsInteger(10, Bits);
(void)Invalid;
assert(!Invalid && "Failed to parse value");

CmdArgs.push_back(
Args.MakeArgString("-mvscale-min=" + llvm::Twine(Bits / 128)));
// Silently drop requests for vector-length agnostic code as it's implied.
} else if (Val != "scalable")
Args.MakeArgString(VScaleMin + llvm::Twine(Bits / 128)));
} else if (Val == "scalable") {
// Silently drop requests for vector-length agnostic code as it's implied.
} else {
// Handle the unsupported values passed to msve-vector-bits.
D.Diag(diag::err_drv_unsupported_option_argument)
<< A->getSpelling() << Val;
}
}
};
if (Arg *A = Args.getLastArg(options::OPT_msve_vector_bits_EQ))
HandleVectorBits(A, "-mvscale-min=", "-mvscale-max=");
if (Arg *A = Args.getLastArg(options::OPT_msve_streaming_vector_bits_EQ))
HandleVectorBits(A, "-mvscale-streaming-min=", "-mvscale-streaming-max=");

AddAAPCSVolatileBitfieldArgs(Args, CmdArgs);

Expand Down
5 changes: 5 additions & 0 deletions clang/lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4560,6 +4560,11 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
if (StringRef(A->getValue()).getAsInteger(10, VScaleMin) || VScaleMin == 0)
Diags.Report(diag::err_cc1_unbounded_vscale_min);
}
if (Arg *A = Args.getLastArg(options::OPT_mvscale_streaming_min_EQ)) {
unsigned VScaleMin;
if (StringRef(A->getValue()).getAsInteger(10, VScaleMin) || VScaleMin == 0)
Diags.Report(diag::err_cc1_unbounded_vscale_min);
}

if (const Arg *A = Args.getLastArg(OPT_frandomize_layout_seed_file_EQ)) {
std::ifstream SeedFile(A->getValue(0));
Expand Down
18 changes: 18 additions & 0 deletions clang/lib/Sema/Sema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2261,6 +2261,24 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
}
}
}

if (auto *VT = Ty->getAs<VectorType>();
VT && FD &&
(VT->getVectorKind() == VectorKind::SveFixedLengthData ||
VT->getVectorKind() == VectorKind::SveFixedLengthPredicate) &&
(LangOpts.VScaleMin != LangOpts.VScaleStreamingMin ||
LangOpts.VScaleMax != LangOpts.VScaleStreamingMax)) {
if (IsArmStreamingFunction(FD, /*IncludeLocallyStreaming=*/true)) {
Diag(Loc, diag::err_sve_fixed_vector_in_streaming_function)
<< Ty << /*Streaming*/ 0;
} else if (const auto *FTy = FD->getType()->getAs<FunctionProtoType>()) {
if (FTy->getAArch64SMEAttributes() &
FunctionType::SME_PStateSMCompatibleMask) {
Diag(Loc, diag::err_sve_fixed_vector_in_streaming_function)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding a diagnostic for this. Can this restriction be limited to the case where sve-vector-bits != streaming-sve-vector-bits?

I think we're also missing a diagnostic for the following case:

typedef svint32_t int32x16_t __attribute__((arm_sve_vector_bits(512)));

svint32_t foo(svint32_t a, svint32_t b) __arm_streaming { return a + b; }

int32x16_t bar_512(int32x16_t a, int32x16_t b) {
  // Cannot convert between int32x16_t and svint32_t if we know that vscale between the functions don't match.
  return foo(a, b);
}

and as an extension, we should do the same for:

void streaming(svint32_t a) __arm_streaming;
void nonstreaming(svint32_t a) { streaming(a); }

when we know that their vscale values don't match.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can allow the use of arm_sve_vector_bits in streaming/streaming-compatible functions if the streaming and non-streaming widths are the same, sure.

Your last two testcases are the same: the conversion happens in the caller, so the first case reduces to the second. Which is an issue, I guess, but not directly related to this patch. It doesn't involve any fixed-width types.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your last two testcases are the same: the conversion happens in the caller, so the first case reduces to the second.

Yes, I agree. I just wasn't sure if it would somehow take a slightly different path in clang somehow.

Which is an issue, I guess, but not directly related to this patch

This patch adds extra information that proves this conversion is not valid, whereas before the compiler could not prove it and assumed the user knew what they were doing. I'm happy for it to be done as a follow-up though.

<< Ty << /*StreamingCompatible*/ 1;
}
}
}
};

CheckType(Ty);
Expand Down
53 changes: 45 additions & 8 deletions clang/lib/Sema/SemaARM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1410,29 +1410,49 @@ void SemaARM::CheckSMEFunctionDefAttributes(const FunctionDecl *FD) {
}

/// getSVETypeSize - Return SVE vector or predicate register size.
static uint64_t getSVETypeSize(ASTContext &Context, const BuiltinType *Ty) {
static uint64_t getSVETypeSize(ASTContext &Context, const BuiltinType *Ty,
bool IsStreaming) {
assert(Ty->isSveVLSBuiltinType() && "Invalid SVE Type");
uint64_t VScale = IsStreaming ? Context.getLangOpts().VScaleStreamingMin
: Context.getLangOpts().VScaleMin;
if (Ty->getKind() == BuiltinType::SveBool ||
Ty->getKind() == BuiltinType::SveCount)
return (Context.getLangOpts().VScaleMin * 128) / Context.getCharWidth();
return Context.getLangOpts().VScaleMin * 128;
return (VScale * 128) / Context.getCharWidth();
return VScale * 128;
}

bool SemaARM::areCompatibleSveTypes(QualType FirstType, QualType SecondType) {
auto IsValidCast = [this](QualType FirstType, QualType SecondType) {
bool IsStreaming = false;
if (getLangOpts().VScaleMin != getLangOpts().VScaleStreamingMin ||
getLangOpts().VScaleMax != getLangOpts().VScaleStreamingMax) {
if (const FunctionDecl *FD =
SemaRef.getCurFunctionDecl(/*AllowLambda=*/true)) {
// For streaming-compatible functions, we don't know vector length.
if (const auto *T = FD->getType()->getAs<FunctionProtoType>()) {
if (T->getAArch64SMEAttributes() &
FunctionType::SME_PStateSMCompatibleMask)
return false;
}

if (IsArmStreamingFunction(FD, /*IncludeLocallyStreaming=*/true))
IsStreaming = true;
}
}

auto IsValidCast = [&](QualType FirstType, QualType SecondType) {
if (const auto *BT = FirstType->getAs<BuiltinType>()) {
if (const auto *VT = SecondType->getAs<VectorType>()) {
ASTContext &Context = getASTContext();
// Predicates have the same representation as uint8 so we also have to
// check the kind to make these types incompatible.
ASTContext &Context = getASTContext();
if (VT->getVectorKind() == VectorKind::SveFixedLengthPredicate)
return BT->getKind() == BuiltinType::SveBool;
else if (VT->getVectorKind() == VectorKind::SveFixedLengthData)
return VT->getElementType().getCanonicalType() ==
FirstType->getSveEltType(Context);
else if (VT->getVectorKind() == VectorKind::Generic)
return Context.getTypeSize(SecondType) ==
getSVETypeSize(Context, BT) &&
getSVETypeSize(Context, BT, IsStreaming) &&
Context.hasSameType(
VT->getElementType(),
Context.getBuiltinVectorTypeInfo(BT).ElementType);
Expand All @@ -1447,7 +1467,23 @@ bool SemaARM::areCompatibleSveTypes(QualType FirstType, QualType SecondType) {

bool SemaARM::areLaxCompatibleSveTypes(QualType FirstType,
QualType SecondType) {
auto IsLaxCompatible = [this](QualType FirstType, QualType SecondType) {
bool IsStreaming = false;
if (getLangOpts().VScaleMin != getLangOpts().VScaleStreamingMin ||
getLangOpts().VScaleMax != getLangOpts().VScaleStreamingMax) {
if (const FunctionDecl *FD =
SemaRef.getCurFunctionDecl(/*AllowLambda=*/true)) {
// For streaming-compatible functions, we don't know vector length.
if (const auto *T = FD->getType()->getAs<FunctionProtoType>())
if (T->getAArch64SMEAttributes() &
FunctionType::SME_PStateSMCompatibleMask)
return false;

if (IsArmStreamingFunction(FD, /*IncludeLocallyStreaming=*/true))
IsStreaming = true;
}
}

auto IsLaxCompatible = [&](QualType FirstType, QualType SecondType) {
const auto *BT = FirstType->getAs<BuiltinType>();
if (!BT)
return false;
Expand All @@ -1471,7 +1507,8 @@ bool SemaARM::areLaxCompatibleSveTypes(QualType FirstType,
// ACLE Spec Version 00bet6, 3.7.3.2. Behavior common to vectors and
// predicates.
if (VecTy->getVectorKind() == VectorKind::Generic &&
Context.getTypeSize(SecondType) != getSVETypeSize(Context, BT))
Context.getTypeSize(SecondType) !=
getSVETypeSize(Context, BT, IsStreaming))
return false;

// If -flax-vector-conversions=all is specified, the types are
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Sema/SemaType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8522,8 +8522,8 @@ static void HandleRISCVRVVVectorBitsTypeAttr(QualType &CurType,
return;
}

auto VScale =
S.Context.getTargetInfo().getVScaleRange(S.getLangOpts(), false);
auto VScale = S.Context.getTargetInfo().getVScaleRange(
S.getLangOpts(), TargetInfo::ArmStreamingKind::NotStreaming);
if (!VScale || !VScale->first || VScale->first != VScale->second) {
S.Diag(Attr.getLoc(), diag::err_attribute_riscv_rvv_bits_unsupported)
<< Attr;
Expand Down
Loading
Loading