-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AArch64] Add option -msve-streaming-vector-bits= . #144611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c28804a
cb8936f
b772f08
6740565
9e3f500
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -823,16 +823,36 @@ AArch64TargetInfo::getTargetBuiltins() const { | |||||
|
||||||
std::optional<std::pair<unsigned, unsigned>> | ||||||
AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts, | ||||||
bool IsArmStreamingFunction, | ||||||
ArmStreamingKind IsArmStreamingFunction, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:
Suggested change
(here and in other places) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just "Mode" on its own seems sort of confusing? Not sure what a better name is, though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think calling the enum There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My primary objection is that Because the variable is of type |
||||||
llvm::StringMap<bool> *FeatureMap) const { | ||||||
if (LangOpts.VScaleMin || LangOpts.VScaleMax) | ||||||
if (IsArmStreamingFunction == 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 (IsArmStreamingFunction == ArmStreamingKind::Streaming && | ||||||
(LangOpts.VScaleStreamingMin || LangOpts.VScaleStreamingMax)) | ||||||
return std::pair<unsigned, unsigned>( | ||||||
LangOpts.VScaleStreamingMin ? LangOpts.VScaleStreamingMin : 1, | ||||||
LangOpts.VScaleStreamingMax ? LangOpts.VScaleStreamingMax : 16); | ||||||
|
||||||
if (IsArmStreamingFunction == 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); | ||||||
} | ||||||
|
||||||
efriedma-quic marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
if (hasFeature("sve") || (FeatureMap && (FeatureMap->lookup("sve")))) | ||||||
return std::pair<unsigned, unsigned>(1, 16); | ||||||
|
||||||
if (IsArmStreamingFunction && | ||||||
if (IsArmStreamingFunction == ArmStreamingKind::Streaming && | ||||||
(hasFeature("sme") || (FeatureMap && (FeatureMap->lookup("sme"))))) | ||||||
return std::pair<unsigned, unsigned>(1, 16); | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2261,6 +2261,21 @@ 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)) { | ||
if (IsArmStreamingFunction(FD, /*IncludeLocallyStreaming=*/true)) { | ||
Diag(Loc, diag::err_sve_fixed_vector_in_streaming_function) << Ty << 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
and as an extension, we should do the same for:
when we know that their vscale values don't match. |
||
<< Ty << 1; | ||
} | ||
} | ||
} | ||
}; | ||
|
||
CheckType(Ty); | ||
|
Uh oh!
There was an error while loading. Please reload this page.