[clang] [clang][FMV][AArch64] Improve streaming mode compatibility. (PR #100181)

Sander de Smalen via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 24 06:01:11 PDT 2024


================
@@ -11145,7 +11148,24 @@ bool Sema::areMultiversionVariantFunctionsCompatible(
     FunctionType::ExtInfo OldTypeInfo = OldType->getExtInfo();
     FunctionType::ExtInfo NewTypeInfo = NewType->getExtInfo();
 
-    if (OldTypeInfo.getCC() != NewTypeInfo.getCC())
+    const auto *OldFPT = OldFD->getType()->getAs<FunctionProtoType>();
+    const auto *NewFPT = NewFD->getType()->getAs<FunctionProtoType>();
+
+    bool ArmStreamingCCMismatched = false;
+    // Locally streaming does not affect the calling convention.
+    if (OldFPT && NewFPT && !OldFD->hasAttr<ArmLocallyStreamingAttr>() &&
+        !NewFD->hasAttr<ArmLocallyStreamingAttr>()) {
----------------
sdesmalen-arm wrote:

`__arm_locally_streaming` tells something about a function's implementation, not the interface. I think there is no problem with one implementation using `__arm_locally_streaming` and the other not using it, as long as their interface have the same streaming property. So if one of the definitions has the `__arm_locally_streaming` attribute, then it's still necessary to check that their streaming mode interface match.

That's why I think there is no need to check for `ArmLocallyStreamingAttr` at all here.

https://github.com/llvm/llvm-project/pull/100181


More information about the cfe-commits mailing list