[clang] [Clang][AArch64] Fix checkArmStreamingBuiltin for 'sve-b16b16' (PR #109420)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 24 06:47:26 PDT 2024


================
@@ -1802,9 +1854,29 @@ void SVEEmitter::createStreamingAttrs(raw_ostream &OS, ACLEKind Kind) {
 
     if (Def->isFlagSet(IsStreamingFlag))
       StreamingMap["ArmStreaming"].insert(Def->getMangledName());
-    else if (Def->isFlagSet(VerifyRuntimeMode))
+    else if (Def->isFlagSet(VerifyRuntimeMode)) {
+      // Verify that the target guards contain at least one feature that
+      // actually enables SVE or SME (explicitly, or implicitly). This is needed
+      // for the code in SemaARM.cpp (checkArmStreamingBuiltin) that checks
+      // whether the required runtime mode for an intrinsic matches with the
+      // given set of target features and function attributes.
+      //
+      // The feature lists below must match the disabled features in
+      // 'checkArmStreamingBuiltin'!
+      if (!Def->getSVEGuard().empty() &&
+          !verifyGuard(Def->getSVEGuard(),
+                       {"sve", "sve2", "sve2p1", "sve2-aes", "sve2-sha3",
----------------
SpencerAbson wrote:

I agree, I think we would definitely benefit in the long-run if we do not have to modify this code when features are added or changed.

(For future work) is it completely crazy to suggest resolving dependency chains back to either SVE or SME (or both/neither) using `ExtensionDependencies`, which is constructed based on the feature definitions in AArch64Features.td?

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


More information about the cfe-commits mailing list