================
@@ -3768,12 +3770,26 @@ void Sema::checkCall(NamedDecl *FDecl, const
FunctionProtoType *Proto,
if (!IsCalleeStreamingCompatible &&
(CallerFnType == SemaARM::ArmStreamingCompatible ||
((CallerFnType == SemaARM::ArmStreaming) ^ IsCalleeStreaming))) {
- if (IsScalableArg)
- Diag(Loc, diag::warn_sme_streaming_pass_return_vl_to_non_streaming)
- << /*IsArg=*/true;
- if (IsScalableRet)
- Diag(Loc, diag::warn_sme_streaming_pass_return_vl_to_non_streaming)
- << /*IsArg=*/false;
+ const LangOptions &LO = getLangOpts();
+ auto VL = LO.VScaleMin * 128;
+ auto SVL = LO.VScaleStreamingMin * 128;
+
+ if (IsScalableArg) {
+ if (VL && SVL && VL != SVL)
+ Diag(Loc, diag::err_sme_streaming_transition_vl_mismatch)
+ << /*IsArg=*/true << VL << SVL;
+ else
+ Diag(Loc, diag::warn_sme_streaming_pass_return_vl_to_non_streaming)
+ << /*IsArg=*/true;
+ }
+ if (IsScalableRet) {
+ if (VL && SVL && VL != SVL)
+ Diag(Loc, diag::err_sme_streaming_transition_vl_mismatch)
+ << /*IsArg=*/false << VL << SVL;
+ else
+ Diag(Loc, diag::warn_sme_streaming_pass_return_vl_to_non_streaming)
+ << /*IsArg=*/false;
+ }
----------------
Fznamznon wrote:
I wonder if we can just merge this like that. I do realize it won't emit an
error for both ret and arg cases if they are not mutually exclusive. Otherwise
wrapping with a lambda probably makes sense
```suggestion
if (IsScalableArg || IsScalableRet) {
if (VL && SVL && VL != SVL)
Diag(Loc, diag::err_sme_streaming_transition_vl_mismatch)
<< IsScalableArg << VL << SVL;
else
Diag(Loc, diag::warn_sme_streaming_pass_return_vl_to_non_streaming)
<< IsScalableArg;
}
```
https://github.com/llvm/llvm-project/pull/159131
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits