[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 09:57:59 PDT 2024


================
@@ -11145,7 +11148,22 @@ 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;
+    if (OldFPT && NewFPT) {
+      unsigned Diff =
+          OldFPT->getAArch64SMEAttributes() ^ NewFPT->getAArch64SMEAttributes();
+      // Streaming versions cannot be mixed with non-streaming versions.
+      if (Diff & FunctionType::SME_PStateSMEnabledMask)
+        ArmStreamingCCMismatched = true;
+      // Streaming-compatible versions cannot be mixed with anything else.
+      if (Diff & FunctionType::SME_PStateSMCompatibleMask)
+        ArmStreamingCCMismatched = true;
----------------
sdesmalen-arm wrote:

nit:
```suggestion
       if (Diff & (FunctionType::SME_PStateSMEnabledMask | 
                   FunctionType::SME_PStateSMCompatibleMask))
         ArmStreamingCCMismatched = true;
```

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


More information about the cfe-commits mailing list