[llvm-branch-commits] [clang] [llvm] [AArch64] Add feature guards to SVE and SME intrinsics (PR #241899)

Sander de Smalen via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Nov 18 01:50:37 PST 2026


https://github.com/sdesmalen-arm updated https://github.com/llvm/llvm-project/pull/241899

>From d7db408da759bae05cc4cdf328db1785c05f09bb Mon Sep 17 00:00:00 2001
From: Sander de Smalen <sander.desmalen at arm.com>
Date: Thu, 5 Nov 2026 16:35:44 +0000
Subject: [PATCH 1/3] [AArch64] Add feature guards to SVE and SME intrinsics

This PR adds streaming/non-streaming feature guards to the SVE and SME
intrinsics. A new verifier pass is added to rejects calls to intrinsics
whose type signature is unavailable for the function's mode and feature
flags.

Some codegen tests needed updating to avoid using types that don't
map to any legal ACLE types.

More as an optional feature; this PR adds a check to Clang's SveEmitter
to ensure that a builtin's type/target maps to a compatible LLVM intrinsic
variant, under the compatible feature flags so that incorrect mappings
are caught during TableGen generation.

I'm happy to split this PR up, but I wasn't sure that was necessarily
going to be more helpful.
---
 clang/include/clang/Basic/CMakeLists.txt      |    8 +-
 .../clang/Basic/arm_sme_intrinsic_guards.td   |   10 +
 .../clang/Basic/arm_sve_intrinsic_guards.td   |   10 +
 .../test/TableGen/arm-sve-intrinsic-guards.td |   90 +
 clang/utils/TableGen/CMakeLists.txt           |    2 +-
 clang/utils/TableGen/SveEmitter.cpp           |  230 +-
 llvm/include/llvm/IR/IntrinsicsAArch64.td     | 4202 ++++++++++-------
 llvm/lib/Target/AArch64/AArch64.h             |    7 +
 .../AArch64/AArch64IntrinsicFeatureChecks.td  |    3 +
 .../AArch64/AArch64IntrinsicsVerifier.cpp     |  236 +
 .../Target/AArch64/AArch64TargetMachine.cpp   |    2 +
 llvm/lib/Target/AArch64/CMakeLists.txt        |    7 +
 llvm/test/CodeGen/AArch64/O0-pipeline.ll      |    1 +
 llvm/test/CodeGen/AArch64/O3-pipeline.ll      |    1 +
 .../AArch64/intrinsics-target-guards.ll       |  143 +
 .../AArch64/sve-implicit-zero-filling.ll      |   42 -
 .../AArch64/sve-intrinsics-loads-ff.ll        |   20 -
 .../AArch64/sve-intrinsics-perm-select.ll     |  448 --
 .../AArch64/sve-intrinsics-pred-operations.ll |   37 -
 .../AArch64/sve-intrinsics-reinterpret.ll     |   24 +-
 llvm/test/CodeGen/AArch64/sve-ld1r.ll         |   63 -
 .../AArch64/sve-ptest-removal-cmpeq.ll        |   13 -
 .../AArch64/sve-ptest-removal-cmpge.ll        |   13 -
 .../AArch64/sve-ptest-removal-cmpgt.ll        |   13 -
 .../AArch64/sve-ptest-removal-cmphi.ll        |   14 -
 .../AArch64/sve-ptest-removal-cmphs.ll        |   13 -
 .../AArch64/sve-ptest-removal-cmple.ll        |  146 -
 .../AArch64/sve-ptest-removal-cmpne.ll        |   13 -
 .../AArch64/sve-ptest-removal-pfirst-pnext.ll |   42 -
 .../CodeGen/AArch64/sve-ptest-removal-sink.ll |   15 +-
 llvm/test/CodeGen/AArch64/sve-ptest.ll        |   60 +-
 llvm/test/CodeGen/AArch64/sve-setcc.ll        |   16 +-
 .../sve-structured-store-memoperands.ll       |    4 +-
 ...ntrinsics-contiguous-conflict-detection.ll |    1 +
 .../CodeGen/AArch64/sve2-intrinsics-psel.ll   |   16 +-
 .../zeroing-forms-frint-frecpx-fsqrt.ll       | 2597 +---------
 .../TableGen/AArch64IntrinsicFeatureChecks.td |   47 +
 .../clang/include/clang/Basic/BUILD.gn        |    4 +-
 .../secondary/clang/utils/TableGen/BUILD.gn   |    1 +
 .../llvm-project-overlay/clang/BUILD.bazel    |   28 +-
 40 files changed, 3528 insertions(+), 5114 deletions(-)
 create mode 100644 clang/include/clang/Basic/arm_sme_intrinsic_guards.td
 create mode 100644 clang/include/clang/Basic/arm_sve_intrinsic_guards.td
 create mode 100644 clang/test/TableGen/arm-sve-intrinsic-guards.td
 create mode 100644 llvm/lib/Target/AArch64/AArch64IntrinsicFeatureChecks.td
 create mode 100644 llvm/lib/Target/AArch64/AArch64IntrinsicsVerifier.cpp
 create mode 100644 llvm/test/CodeGen/AArch64/intrinsics-target-guards.ll
 create mode 100644 llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td

diff --git a/clang/include/clang/Basic/CMakeLists.txt b/clang/include/clang/Basic/CMakeLists.txt
index 8cb474d044bef9..e9511e46f3d59d 100644
--- a/clang/include/clang/Basic/CMakeLists.txt
+++ b/clang/include/clang/Basic/CMakeLists.txt
@@ -196,7 +196,9 @@ clang_tablegen(arm_sve_builtins.json -gen-arm-sve-builtins-json
   SOURCE arm_sve.td
   TARGET ClangARMSveBuiltinsJSON)
 clang_tablegen(arm_sve_builtin_cg.inc -gen-arm-sve-builtin-codegen
-  SOURCE arm_sve.td
+  SOURCE arm_sve_intrinsic_guards.td
+  DEPENDS ${LLVM_MAIN_SRC_DIR}/include/llvm/IR/Intrinsics.td
+          ${LLVM_MAIN_SRC_DIR}/include/llvm/IR/IntrinsicsAArch64.td
   TARGET ClangARMSveBuiltinCG)
 clang_tablegen(arm_sve_typeflags.inc -gen-arm-sve-typeflags
   SOURCE arm_sve.td
@@ -214,7 +216,9 @@ clang_tablegen(arm_sme_builtins.json -gen-arm-sme-builtins-json
   SOURCE arm_sme.td
   TARGET ClangARMSmeBuiltinsJSON)
 clang_tablegen(arm_sme_builtin_cg.inc -gen-arm-sme-builtin-codegen
-  SOURCE arm_sme.td
+  SOURCE arm_sme_intrinsic_guards.td
+  DEPENDS ${LLVM_MAIN_SRC_DIR}/include/llvm/IR/Intrinsics.td
+          ${LLVM_MAIN_SRC_DIR}/include/llvm/IR/IntrinsicsAArch64.td
   TARGET ClangARMSmeBuiltinCG)
 clang_tablegen(arm_sme_sema_rangechecks.inc -gen-arm-sme-sema-rangechecks
   SOURCE arm_sme.td
diff --git a/clang/include/clang/Basic/arm_sme_intrinsic_guards.td b/clang/include/clang/Basic/arm_sme_intrinsic_guards.td
new file mode 100644
index 00000000000000..bee0dcecb8c24e
--- /dev/null
+++ b/clang/include/clang/Basic/arm_sme_intrinsic_guards.td
@@ -0,0 +1,10 @@
+//===- arm_sme_intrinsic_guards.td - SME builtin guard checks -*- tablegen -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// TableGen input for checking SME builtin and LLVM intrinsic target guards.
+// Intrinsics.td includes IntrinsicsAArch64.td.
+include "llvm/IR/Intrinsics.td"
+include "arm_sme.td"
diff --git a/clang/include/clang/Basic/arm_sve_intrinsic_guards.td b/clang/include/clang/Basic/arm_sve_intrinsic_guards.td
new file mode 100644
index 00000000000000..8834fcf0c7dfb4
--- /dev/null
+++ b/clang/include/clang/Basic/arm_sve_intrinsic_guards.td
@@ -0,0 +1,10 @@
+//===- arm_sve_intrinsic_guards.td - SVE builtin guard checks -*- tablegen -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// TableGen input for checking SVE builtin and LLVM intrinsic target guards.
+// Intrinsics.td includes IntrinsicsAArch64.td.
+include "llvm/IR/Intrinsics.td"
+include "arm_sve.td"
diff --git a/clang/test/TableGen/arm-sve-intrinsic-guards.td b/clang/test/TableGen/arm-sve-intrinsic-guards.td
new file mode 100644
index 00000000000000..560876839cf5e7
--- /dev/null
+++ b/clang/test/TableGen/arm-sve-intrinsic-guards.td
@@ -0,0 +1,90 @@
+// RUN: clang-tblgen -gen-arm-sve-builtin-codegen \
+// RUN:   -I %S/../../../llvm/include \
+// RUN:   -I %S/../../include/clang/Basic %s -o /dev/null
+// RUN: clang-tblgen -gen-arm-sve-builtin-codegen -DSTRONGER_GUARD \
+// RUN:   -I %S/../../../llvm/include \
+// RUN:   -I %S/../../include/clang/Basic %s -o /dev/null
+// RUN: not clang-tblgen -gen-arm-sve-builtin-codegen -DBAD_GUARD \
+// RUN:   -I %S/../../../llvm/include \
+// RUN:   -I %S/../../include/clang/Basic %s -o /dev/null 2>&1 | FileCheck %s
+// RUN: not clang-tblgen -gen-arm-sve-builtin-codegen -DBAD_BF16_GUARD \
+// RUN:   -I %S/../../../llvm/include \
+// RUN:   -I %S/../../include/clang/Basic %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=BF16
+// RUN: not clang-tblgen -gen-arm-sve-builtin-codegen -DBAD_PREDICATE_TYPE \
+// RUN:   -I %S/../../../llvm/include \
+// RUN:   -I %S/../../include/clang/Basic %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=PREDICATE
+// RUN: not clang-tblgen -gen-arm-sve-builtin-codegen -DBAD_MULTI_VECTOR_TYPE \
+// RUN:   -I %S/../../../llvm/include \
+// RUN:   -I %S/../../include/clang/Basic %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=MULTIVECTOR
+// RUN: not clang-tblgen -gen-arm-sve-builtin-codegen -DBAD_NONOVERLOADED_TYPE \
+// RUN:   -I %S/../../../llvm/include \
+// RUN:   -I %S/../../include/clang/Basic %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=NONOVERLOADED
+
+include "arm_sve_intrinsic_guards.td"
+
+// The P prototype modifier creates a predicate with an ordinary type spec.
+let TargetGuards = [Variant<"sve", "sme", [[llvm_nxv16i1_ty]]>] in
+def int_aarch64_sve_guard_predicate_proto
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty], [llvm_nxv16i8_ty],
+                              [IntrNoMem]>;
+
+def GOOD_PREDICATE_PROTO : SInst<"svguard_predicate_proto[_{d}]", "Pd", "c",
+                                 MergeNone, "aarch64_sve_guard_predicate_proto">;
+
+let TargetGuards = [Variant<"sve", "sme", EmptyOverload>] in
+def int_aarch64_sve_guard_nonoverloaded
+    : GuardedDefaultIntrinsic<[llvm_nxv16i8_ty], [llvm_nxv16i8_ty],
+                              [IntrNoMem]>;
+
+def GOOD_NONOVERLOADED_TYPE
+    : SInst<"svguard_nonoverloaded[_{d}]", "dd", "c", MergeNone,
+            "aarch64_sve_guard_nonoverloaded", [IsOverloadNone]>;
+
+#ifdef BAD_NONOVERLOADED_TYPE
+def BAD_NONOVERLOADED_TYPE
+    : SInst<"svguard_wrong_overload[_{d}]", "dd", "c", MergeNone,
+            "aarch64_sve_guard_nonoverloaded">;
+#endif
+
+// NONOVERLOADED: cannot identify target guard variant for builtin svguard_wrong_overload_s8
+
+let TargetGuards = [Variant<"sve", "sme", [[LLVMType<nxv32i8>]]>] in
+def int_aarch64_sve_guard_multivector
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
+                              [LLVMMatchType<0>, LLVMMatchType<0>],
+                              [IntrNoMem]>;
+
+#ifdef BAD_MULTI_VECTOR_TYPE
+def BAD_MULTI_VECTOR_TYPE : SInst<"svguard_nonmultivector[_{d}]", "ddd", "c",
+                                  MergeNone, "aarch64_sve_guard_multivector">;
+#endif
+
+// MULTIVECTOR: cannot identify target guard variant for builtin svguard_nonmultivector_s8
+
+#ifdef STRONGER_GUARD
+let SVETargetGuard = "sve2p2|sme2p2", SMETargetGuard = "sme2p2" in
+def STRONGER_GUARD : SInst<"svguard_stronger[_{d}]", "ddd", "i", MergeNone,
+                           "aarch64_sve_addp">;
+#endif
+
+#ifdef BAD_GUARD
+def BAD_GUARD : SInst<"svguard_mismatch[_{d}]", "ddd", "i", MergeNone,
+                        "aarch64_sve_addp">;
+#endif
+
+// CHECK: builtin svguard_mismatch_s32 targeting aarch64_sve_addp has guards ['sve', 'sme']; intrinsic variants have ['sve,(sve2|sme)', 'sme']
+
+#ifdef BAD_BF16_GUARD
+def BAD_BF16_GUARD : SInst<"svguard_bf16[_{d}]", "dddd", "b", MergeNone,
+                             "aarch64_sve_fadd">;
+#endif
+
+// BF16: builtin svguard_bf16_bf16 targeting aarch64_sve_fadd has guards ['sve', 'sme']; intrinsic variants have ['sve,sve-b16b16', 'sme2,sve-b16b16']
+
+#ifdef BAD_PREDICATE_TYPE
+let SVETargetGuard = "sve2p1", SMETargetGuard = "sve2p1|sme2" in
+def BAD_PREDICATE_TYPE : SInst<"svguard_nonpredicate[_{d}]", "}}i", "Qc",
+                              MergeNone, "aarch64_sve_pext">;
+#endif
+
+// PREDICATE: cannot identify target guard variant for builtin svguard_nonpredicate_c8
diff --git a/clang/utils/TableGen/CMakeLists.txt b/clang/utils/TableGen/CMakeLists.txt
index 963a753bf057a7..f34c1ed004a715 100644
--- a/clang/utils/TableGen/CMakeLists.txt
+++ b/clang/utils/TableGen/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(LLVM_LINK_COMPONENTS Support)
+set(LLVM_LINK_COMPONENTS Support TargetParser)
 
 add_tablegen(clang-tblgen CLANG
   DESTINATION "${CLANG_TOOLS_INSTALL_DIR}"
diff --git a/clang/utils/TableGen/SveEmitter.cpp b/clang/utils/TableGen/SveEmitter.cpp
index 0f770a3202538e..a9cd6f49ec492d 100644
--- a/clang/utils/TableGen/SveEmitter.cpp
+++ b/clang/utils/TableGen/SveEmitter.cpp
@@ -19,7 +19,7 @@
 // by calling a __builtin_-prefixed function which will be handled by clang's
 // CodeGen library.
 //
-// See also the documentation in include/clang/Basic/arm_sve.td.
+// See also the documentation in clang/include/clang/Basic/arm_sve.td.
 //
 //===----------------------------------------------------------------------===//
 
@@ -30,10 +30,14 @@
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/TableGen/AArch64ImmCheck.h"
 #include "llvm/TableGen/Error.h"
+#include "llvm/TableGen/FeatureGuardParser.h"
+#include "llvm/TableGen/GuardedIntrinsic.h"
 #include "llvm/TableGen/Record.h"
 #include "llvm/TableGen/StringToOffsetTable.h"
+#include "llvm/TargetParser/AArch64TargetParser.h"
 #include <array>
 #include <cctype>
+#include <map>
 #include <set>
 #include <string>
 #include <tuple>
@@ -449,6 +453,13 @@ class SVEEmitter {
   /// Create intrinsic and add it to \p Out
   void createIntrinsic(const Record *R,
                        SmallVectorImpl<std::unique_ptr<Intrinsic>> &Out);
+
+private:
+  SmallVector<GuardedIntrinsicVariant>
+  collectIntrinsicVariantsForBuiltin(const Record *IRIntrinsicRecord,
+                                     const Intrinsic &Def) const;
+  void verifyLLVMIntrinsicGuards(
+      const SmallVectorImpl<std::unique_ptr<Intrinsic>> &Defs) const;
 };
 
 const std::array<SVEEmitter::ReinterpretTypeInfo, 13> SVEEmitter::Reinterprets =
@@ -1680,12 +1691,229 @@ void SVEEmitter::createBuiltinsJSON(raw_ostream &OS) {
   OS << "\n]\n";
 }
 
+static bool
+intrinsicClauseIsAvailable(const RequiredFeatureSet &IntrinsicClause,
+                           const RequiredFeatureSet &BuiltinClause,
+                           const AArch64::ExtensionSet &Enabled) {
+  for (StringRef Feature : IntrinsicClause) {
+    if (BuiltinClause.count(Feature.str()))
+      continue;
+    auto Extension = AArch64::targetFeatureToExtension(("+" + Feature).str());
+    if (!Extension || !Enabled.Enabled.test(Extension->ID))
+      return false;
+  }
+  return true;
+}
+
+AArch64::ExtensionSet expandImpliedTargetFeatures(const RequiredFeatureSet &C) {
+  AArch64::ExtensionSet Enabled;
+  for (StringRef Feature : C) {
+    if (auto Extension =
+            AArch64::targetFeatureToExtension(("+" + Feature).str()))
+      Enabled.enable(Extension->ID);
+  }
+  return Enabled;
+}
+static bool builtinGuardImpliesIntrinsicGuard(
+    const FeatureGuardAlternatives &BuiltinGuards,
+    const FeatureGuardAlternatives &IntrinsicGuards, bool StreamingMode) {
+  // Every configuration admitted by the builtin must satisfy at least one
+  // intrinsic clause. Account for AArch64 feature dependencies, e.g. sve2p2
+  // implies sve2 and sve, and for SME being available in streaming mode.
+  for (const RequiredFeatureSet &BuiltinClause : BuiltinGuards) {
+    AArch64::ExtensionSet Enabled = expandImpliedTargetFeatures(BuiltinClause);
+    if (StreamingMode)
+      Enabled.enable(AArch64::AEK_SME);
+
+    if (!any_of(IntrinsicGuards, [&](const RequiredFeatureSet &C) {
+          return intrinsicClauseIsAvailable(C, BuiltinClause, Enabled);
+        }))
+      return false;
+  }
+  return true;
+}
+
+static std::string baseVectorVT(const SVEType &T) {
+  if (!T.isScalableVector() || T.getNumVectors() != 1 || T.isInvalid())
+    return {};
+  std::string Element;
+  if (T.isBFloat())
+    Element = "bf16";
+  else if (T.isFloat())
+    Element = "f" + std::to_string(T.getElementSizeInBits());
+  else
+    Element =
+        "i" + std::to_string(T.isPredicate() ? 1 : T.getElementSizeInBits());
+  return "nxv" + std::to_string(T.getNumElements()) + Element;
+}
+
+// Return the variants of the LLVM IR intrinsic that are relevant to the types
+// used for the current builtin \p Def. Reports an error if no intrinsic
+// variants match the types of the builtin.
+SmallVector<GuardedIntrinsicVariant>
+SVEEmitter::collectIntrinsicVariantsForBuiltin(const Record *IRIntrinsicRecord,
+                                               const Intrinsic &Def) const {
+  auto Variants = collectGuardedIntrinsicVariants(IRIntrinsicRecord);
+  if (Variants.empty() ||
+      llvm::any_of(Variants, [](const GuardedIntrinsicVariant &V) {
+        return !V.OverloadTypes;
+      }))
+    PrintFatalError(IRIntrinsicRecord,
+                    "intrinsic has no target guard variants");
+
+  for (const GuardedIntrinsicVariant &V : Variants)
+    if (V.Guard->getValueAsListOfStrings("Guards").size() != 2)
+      PrintFatalError(V.Guard,
+                      "AArch64 intrinsic variant must have two guards, one "
+                      "for non-streaming mode and one for streaming mode.");
+
+  std::string BaseVT = baseVectorVT(Def.getBaseType());
+  bool BuiltinIsOverloadNone =
+      Def.isFlagSet(getEnumValueForFlag("IsOverloadNone"));
+  SmallVector<GuardedIntrinsicVariant> Candidates;
+  for (const GuardedIntrinsicVariant &V : Variants) {
+    auto OverloadTypes = getGuardedOverloadTypes(V.OverloadTypes);
+    // A nonoverloaded intrinsic has one empty overload type list.
+    if ((BuiltinIsOverloadNone && OverloadTypes.empty()) ||
+        llvm::any_of(OverloadTypes, [&](const Record *T) {
+          return T->getValueAsDef("VT")->getName() == BaseVT;
+        }))
+      Candidates.push_back(V);
+  }
+
+  // Predicate overloads have i1 elements, while the ACLE base (overload) type
+  // can be based on the element type which the predicate applies to for
+  // creating e.g. _b8/_b16/.. forms. We need to add those forms separately, but
+  // only use this fallback when the builtin itself has a predicate result or
+  // operand.
+  if (Candidates.empty() && Def.getBaseType().isScalableVector() &&
+      llvm::any_of(Def.getTypes(), [](const SVEType &T) {
+        return T.isPredicate() && T.isScalableVector();
+      })) {
+    unsigned Elements = Def.getBaseType().getNumElements();
+    const Record *I1 = Records.getDef("i1");
+
+    for (const GuardedIntrinsicVariant &V : Variants)
+      if (llvm::any_of(getGuardedOverloadTypes(V.OverloadTypes),
+                       [&](const Record *T) {
+                         const Record *VT = T->getValueAsDef("VT");
+                         return VT->getValueAsBit("isVector") &&
+                                VT->getValueAsBit("isScalable") &&
+                                VT->getValueAsDef("ElementType") == I1 &&
+                                VT->getValueAsInt("nElem") == Elements;
+                       }))
+        Candidates.push_back(V);
+  }
+
+  if (Candidates.empty())
+    PrintFatalError(IRIntrinsicRecord,
+                    "cannot identify target guard variant for builtin " +
+                        Def.getMangledName() + " (base type " +
+                        Def.getBaseType().str() + ", VT " + BaseVT + ")");
+  return Candidates;
+}
+
+// Return true when the builtin's target guards match the LLVM IR intrinsic
+// variant in both non-streaming and streaming modes.
+static bool matchBuiltinToVariants(const Record *IRIntrinsicRecord,
+                                   StringRef SVEGuard, StringRef SMEGuard,
+                                   ArrayRef<GuardedIntrinsicVariant> Variants) {
+  return llvm::any_of(Variants, [&](const GuardedIntrinsicVariant &V) {
+    auto IRGuards = V.Guard->getValueAsListOfStrings("Guards");
+    auto ReportGuardError = [&](const Twine &Message) {
+      PrintFatalError(IRIntrinsicRecord, Message);
+    };
+    // AArch64 guard 0 is non-streaming; guard 1 is streaming.
+    auto MatchesMode = [&](unsigned Mode) {
+      FeatureGuardAlternatives ClangGuard =
+          FeatureGuardParser(Mode ? SMEGuard : SVEGuard, ReportGuardError)
+              .parse();
+      FeatureGuardAlternatives LLVMGuard =
+          FeatureGuardParser(IRGuards[Mode], ReportGuardError).parse();
+      return builtinGuardImpliesIntrinsicGuard(ClangGuard, LLVMGuard,
+                                               Mode == 1);
+    };
+    return MatchesMode(0) && MatchesMode(1);
+  });
+}
+
+void SVEEmitter::verifyLLVMIntrinsicGuards(
+    const SmallVectorImpl<std::unique_ptr<Intrinsic>> &Defs) const {
+  std::vector<std::string> Mismatches;
+  for (const auto &Def : Defs) {
+    // Only consider the full builtin (not the short-form)
+    if (Def->getClassKind() == ClassG)
+      continue;
+
+    std::string LLVMName = Def->getMangledLLVMName();
+    if (LLVMName.empty())
+      continue;
+
+    // We can only verify builtins that specify a Guarded LLVM intrinsic.
+    const Record *IRIntrinsicRecord = Records.getDef("int_" + LLVMName);
+    if (!IRIntrinsicRecord)
+      PrintFatalError("missing LLVM intrinsic for builtin " +
+                      Def->getMangledName() + ": " + LLVMName);
+    if (!IRIntrinsicRecord->isSubClassOf("GuardedIntrinsic") ||
+        IRIntrinsicRecord->getValueAsListOfDefs("TargetGuards").empty()) {
+      if (StringRef(LLVMName).starts_with("aarch64_") &&
+          IRIntrinsicRecord->getValueAsDef("TypeInfo")
+              ->getValueAsBit("isOverloaded"))
+        PrintFatalError(IRIntrinsicRecord,
+                        "overloaded LLVM intrinsic mapped by builtin " +
+                            Def->getMangledName() + " has no target guards");
+      continue;
+    }
+
+    // Test whether there is a matching LLVM IR intrinsic variant for the
+    // current builtin.
+    auto Variants = collectIntrinsicVariantsForBuiltin(IRIntrinsicRecord, *Def);
+    StringRef SVEGuard = Def->getSVEGuard();
+    StringRef SMEGuard = Def->getSMEGuard();
+    if (Def->isFlagSet(getEnumValueForFlag("IsStreamingCompatible"))) {
+      SVEGuard = SVEGuard.empty() ? SMEGuard : SVEGuard;
+      SMEGuard = SMEGuard.empty() ? SVEGuard : SMEGuard;
+    }
+    if (matchBuiltinToVariants(IRIntrinsicRecord, SVEGuard, SMEGuard, Variants))
+      continue;
+
+    // If no matching intrinsic variant exists, collect an error diagnostic
+    // to emit later.
+    std::string LLVMGuards;
+    std::set<std::string> SeenLLVMGuards;
+    for (const GuardedIntrinsicVariant &V : Variants) {
+      auto IRGuards = V.Guard->getValueAsListOfStrings("Guards");
+      std::string GuardPair =
+          ("['" + IRGuards[0] + "', '" + IRGuards[1] + "']").str();
+      if (SeenLLVMGuards.insert(GuardPair).second) {
+        if (!LLVMGuards.empty())
+          LLVMGuards += " or ";
+        LLVMGuards += GuardPair;
+      }
+    }
+    Mismatches.push_back("builtin " + Def->getMangledName() + " targeting " +
+                         LLVMName + " has guards ['" + SVEGuard.str() + "', '" +
+                         SMEGuard.str() + "']; intrinsic variants have " +
+                         LLVMGuards);
+  }
+  // Print all error messages (but only fatal error once).
+  if (!Mismatches.empty()) {
+    std::string Message = std::to_string(Mismatches.size()) +
+                          " SVE/SME builtin target guard mismatches:\n";
+    for (StringRef Mismatch : llvm::ArrayRef(Mismatches).take_front(20))
+      Message += "  " + Mismatch.str() + "\n";
+    PrintFatalError(Message);
+  }
+}
+
 void SVEEmitter::createCodeGenMap(raw_ostream &OS) {
   std::vector<const Record *> RV = Records.getAllDerivedDefinitions("Inst");
   SmallVector<std::unique_ptr<Intrinsic>, 128> Defs;
   for (auto *R : RV)
     createIntrinsic(R, Defs);
 
+  verifyLLVMIntrinsicGuards(Defs);
+
   // The mappings must be sorted based on BuiltinID.
   sort(Defs, [](const std::unique_ptr<Intrinsic> &A,
                 const std::unique_ptr<Intrinsic> &B) {
diff --git a/llvm/include/llvm/IR/IntrinsicsAArch64.td b/llvm/include/llvm/IR/IntrinsicsAArch64.td
index d05f36c86b8191..14c70b02bbffbf 100644
--- a/llvm/include/llvm/IR/IntrinsicsAArch64.td
+++ b/llvm/include/llvm/IR/IntrinsicsAArch64.td
@@ -7,9 +7,32 @@
 //===----------------------------------------------------------------------===//
 //
 // This file defines all of the AARCH64-specific intrinsics.
+// SVE/SME TargetGuards describe legal overloads and feature requirements of
+// the intrinsics below.
 //
 //===----------------------------------------------------------------------===//
 
+// Legal overloads and non-streaming and streaming feature guards.
+// Non-streaming guards explicitly require SVE when needed; streaming mode
+// supplies SME. An empty guard makes that mode unavailable.
+// NonStreamingVariant and StreamingVariant take one guard for intrinsics
+// available in only one mode.
+// Each inner type list is an independent overload in intrinsic overload-index
+// order. Dependent and fixed result and operand types are inferred by TableGen.
+defvar Invalid = "";
+
+class Variant<string nonStreamingGuard, string streamingGuard,
+              list<list<LLVMType>> overloads>
+    : GuardedVariant<[nonStreamingGuard, streamingGuard], overloads>;
+
+class NonStreamingVariant<string nonStreamingGuard,
+                          list<list<LLVMType>> overloads>
+    : Variant<nonStreamingGuard, Invalid, overloads>;
+
+class StreamingVariant<string streamingGuard,
+                       list<list<LLVMType>> overloads>
+    : Variant<Invalid, streamingGuard, overloads>;
+
 let TargetPrefix = "aarch64" in {
 
 def int_aarch64_ldxr : Intrinsic<[llvm_i64_ty], [llvm_anyptr_ty],
@@ -135,7 +158,6 @@ def int_aarch64_gcspopm : ClangBuiltin<"__builtin_arm_gcspopm">,
 
 def int_aarch64_gcsss : ClangBuiltin<"__builtin_arm_gcsss">,
                         DefaultAttrsIntrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
-
 }
 
 //===----------------------------------------------------------------------===//
@@ -155,6 +177,9 @@ let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
     : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>], [IntrNoMem]>;
   class AdvSIMD_1VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
     : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [LLVMMatchType<0>], !listconcat(Attrs, [IntrNoMem])>;
+
+  class Guarded_AdvSIMD_1VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty], [LLVMMatchType<0>], !listconcat(Attrs, [IntrNoMem])>;
   class AdvSIMD_1VectorArg_Expand_Intrinsic
     : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [llvm_anyvector_ty], [IntrNoMem]>;
   class AdvSIMD_1IntArg_Narrow_Intrinsic
@@ -175,9 +200,17 @@ let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
   class AdvSIMD_2VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
     : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
+
+  class Guarded_AdvSIMD_2VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty], [LLVMMatchType<0>, LLVMMatchType<0>],
+                !listconcat(Attrs, [IntrNoMem])>;
   class AdvSIMD_2Arg_FloatCompare_Intrinsic
     : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty, LLVMMatchType<1>],
                 [IntrNoMem]>;
+
+  class Guarded_AdvSIMD_2Arg_FloatCompare_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty, LLVMMatchType<1>],
+                [IntrNoMem]>;
   class AdvSIMD_2VectorArg_Long_Intrinsic
     : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
                 [LLVMTruncatedType<0>, LLVMTruncatedType<0>],
@@ -210,6 +243,11 @@ let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
       : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
                [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
                !listconcat(Attrs, [IntrNoMem])>;
+
+  class Guarded_AdvSIMD_3VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
+      : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
+               [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
+               !listconcat(Attrs, [IntrNoMem])>;
   class AdvSIMD_3VectorArg_Scalar_Intrinsic
       : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
                [LLVMMatchType<0>, LLVMMatchType<0>, llvm_i32_ty],
@@ -1067,188 +1105,290 @@ def llvm_nxv8bf16_ty : LLVMType<nxv8bf16>;
 def llvm_nxv4f32_ty : LLVMType<nxv4f32>;
 def llvm_nxv2f64_ty : LLVMType<nxv2f64>;
 
+// Type overloads
+defvar EmptyOverload = [[]<LLVMType>];
+
+// Integer type overloads
+defvar I8_Overloads = [[llvm_nxv16i8_ty]];
+defvar I16_Overloads = [[llvm_nxv8i16_ty]];
+defvar I32_Overloads = [[llvm_nxv4i32_ty]];
+defvar I64_Overloads = [[llvm_nxv2i64_ty]];
+
+defvar I8_I16_Overloads = [[llvm_nxv16i8_ty], [llvm_nxv8i16_ty]];
+defvar I16_I32_Overloads = [[llvm_nxv4i32_ty], [llvm_nxv8i16_ty]];
+defvar I32_I64_Overloads = [[llvm_nxv2i64_ty], [llvm_nxv4i32_ty]];
+
+defvar I8_I16_I32_Overloads = [[llvm_nxv16i8_ty], [llvm_nxv4i32_ty], [llvm_nxv8i16_ty]];
+defvar I16_I32_I64_Overloads = [[llvm_nxv2i64_ty], [llvm_nxv4i32_ty], [llvm_nxv8i16_ty]];
+
+defvar I8_I16_I32_I64_Overloads = [[llvm_nxv16i8_ty], [llvm_nxv8i16_ty], [llvm_nxv4i32_ty], [llvm_nxv2i64_ty]];
+
+// Floating point type overloads
+defvar BF16_Overloads = [[llvm_nxv8bf16_ty]];
+defvar F16_Overloads = [[llvm_nxv8f16_ty]];
+defvar F32_Overloads = [[llvm_nxv4f32_ty]];
+defvar F64_Overloads = [[llvm_nxv2f64_ty]];
+
+defvar BF16_F16_Overloads = [[llvm_nxv8bf16_ty], [llvm_nxv8f16_ty]];
+defvar F16_F32_Overloads = [[llvm_nxv4f32_ty], [llvm_nxv8f16_ty]];
+defvar F32_F64_Overloads = [[llvm_nxv2f64_ty], [llvm_nxv4f32_ty]];
+
+defvar F16_F32_F64_Overloads = [[llvm_nxv8f16_ty], [llvm_nxv4f32_ty], [llvm_nxv2f64_ty]];
+defvar BF16_F16_F32_Overloads = [[llvm_nxv4f32_ty], [llvm_nxv8bf16_ty], [llvm_nxv8f16_ty]];
+defvar BF16_F16_I16_Overloads = [[llvm_nxv8bf16_ty], [llvm_nxv8f16_ty], [llvm_nxv8i16_ty]];
+
+defvar I8_I16_BF16_F16_Overloads = [[llvm_nxv16i8_ty], [llvm_nxv8bf16_ty], [llvm_nxv8f16_ty], [llvm_nxv8i16_ty]];
+defvar I32_I64_F32_F64_Overloads = [[llvm_nxv2f64_ty], [llvm_nxv2i64_ty], [llvm_nxv4f32_ty], [llvm_nxv4i32_ty]];
+
+defvar F64F64_OverloadPair = [[llvm_nxv2f64_ty, llvm_nxv2f64_ty]];
+defvar F32F32_OverloadPair = [[llvm_nxv4f32_ty, llvm_nxv4f32_ty]];
+defvar F32BF16_OverloadPair = [[llvm_nxv4f32_ty, llvm_nxv8bf16_ty]];
+defvar F32F16_OverloadPair = [[llvm_nxv4f32_ty, llvm_nxv8f16_ty]];
+defvar BF16BF16_OverloadPair = [[llvm_nxv8bf16_ty, llvm_nxv8bf16_ty]];
+defvar F16F16_OverloadPair = [[llvm_nxv8f16_ty, llvm_nxv8f16_ty]];
+
+defvar UnpackedIntegerDataVectorTypes = [
+  LLVMType<nxv2i8>, LLVMType<nxv4i8>, LLVMType<nxv8i8>,
+  LLVMType<nxv2i16>, LLVMType<nxv4i16>,
+  LLVMType<nxv2i32>
+];
+
+defvar PackedIntegerVectorTypes = [
+  llvm_nxv16i8_ty, llvm_nxv2i64_ty, llvm_nxv4i32_ty, llvm_nxv8i16_ty
+];
+
+defvar PackedFPVectorTypes = [
+  llvm_nxv8f16_ty, llvm_nxv8bf16_ty, llvm_nxv4f32_ty, llvm_nxv2f64_ty
+];
+
+defvar PackedDataVectorTypes = !listconcat(PackedIntegerVectorTypes, PackedFPVectorTypes);
+
+defvar AllPackedData_Overloads = !foreach(T, PackedDataVectorTypes, [T]);
+
+// Predicate type overloads
+defvar Predicate_Overloads = [
+  [llvm_nxv16i1_ty],
+  [llvm_nxv8i1_ty],
+  [llvm_nxv4i1_ty],
+  [llvm_nxv2i1_ty]
+];
+
+// Pointer related
+defvar PTR_Overloads = [[llvm_ptr_ty]];
+
+defvar F64PTR_I64PTR_OverloadPair = [
+  [llvm_nxv2f64_ty, llvm_ptr_ty],
+  [llvm_nxv2i64_ty, llvm_ptr_ty],
+];
+
+defvar F32PTR_I32PTR_OverloadPair = [
+  [llvm_nxv4f32_ty, llvm_ptr_ty],
+  [llvm_nxv4i32_ty, llvm_ptr_ty],
+];
+
+defvar PredicatePTR_OverloadPairs = [
+  [llvm_nxv16i1_ty, llvm_ptr_ty],
+  [llvm_nxv8i1_ty, llvm_ptr_ty],
+  [llvm_nxv4i1_ty, llvm_ptr_ty],
+  [llvm_nxv2i1_ty, llvm_ptr_ty],
+];
+
+defvar DataPTR_OverloadPairs =
+  !foreach(T, !listconcat(PackedDataVectorTypes, UnpackedIntegerDataVectorTypes), [T, llvm_ptr_ty]);
+
+defvar PackedDataPTR_OverloadPairs =
+  !foreach(T, PackedDataVectorTypes, [T, llvm_ptr_ty]);
+
+defvar PackedDataI64_OverloadPairs =
+  !foreach(T, PackedDataVectorTypes, [T, llvm_nxv2i64_ty]);
+
+defvar DataI32_DataI64_OverloadPairs =
+  !listconcat(
+    !foreach(T, !listconcat(PackedDataVectorTypes, UnpackedIntegerDataVectorTypes), [T, llvm_nxv4i32_ty]),
+    !foreach(T, !listconcat(PackedDataVectorTypes, UnpackedIntegerDataVectorTypes), [T, llvm_nxv2i64_ty]));
+
 let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
 
-  class AdvSIMD_1Vec_PredLoad_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_1Vec_PredLoad_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyptr_ty],
                 [IntrReadMem, IntrArgMemOnly]>;
 
-  class AdvSIMD_2Vec_PredLoad_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_AdvSIMD_2Vec_PredLoad_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyptr_ty],
                 [IntrReadMem, IntrArgMemOnly]>;
 
-  class AdvSIMD_3Vec_PredLoad_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>],
+  class Guarded_AdvSIMD_3Vec_PredLoad_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyptr_ty],
                 [IntrReadMem, IntrArgMemOnly]>;
 
-  class AdvSIMD_4Vec_PredLoad_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>,
+  class Guarded_AdvSIMD_4Vec_PredLoad_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMMatchType<0>],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyptr_ty],
                 [IntrReadMem, IntrArgMemOnly]>;
 
-  class AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyptr_ty],
                 [IntrRead<[ArgMem, FFR]>, IntrWrite<[FFR]>]>;
 
-  class AdvSIMD_1Vec_PredStore_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+  class Guarded_AdvSIMD_1Vec_PredStore_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                 [llvm_anyvector_ty,
                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyptr_ty],
                 [IntrArgMemOnly, NoCapture<ArgIndex<2>>]>;
 
-  class AdvSIMD_2Vec_PredStore_Intrinsic
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_AdvSIMD_2Vec_PredStore_Intrinsic
+      : GuardedDefaultIntrinsic<[],
                   [llvm_anyvector_ty, LLVMMatchType<0>,
                    LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyptr_ty],
                   [IntrArgMemOnly, NoCapture<ArgIndex<3>>]>;
 
-  class AdvSIMD_3Vec_PredStore_Intrinsic
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_AdvSIMD_3Vec_PredStore_Intrinsic
+      : GuardedDefaultIntrinsic<[],
                   [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>,
                    LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyptr_ty],
                   [IntrArgMemOnly, NoCapture<ArgIndex<4>>]>;
 
-  class AdvSIMD_4Vec_PredStore_Intrinsic
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_AdvSIMD_4Vec_PredStore_Intrinsic
+      : GuardedDefaultIntrinsic<[],
                   [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>,
                    LLVMMatchType<0>,
                    LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyptr_ty],
                   [IntrArgMemOnly, NoCapture<ArgIndex<5>>]>;
 
-  class AdvSIMD_SVE_Index_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_Index_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMVectorElementType<0>,
                  LLVMVectorElementType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_Merged1VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  LLVMMatchType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_2VectorArgIndexed_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMMatchType<0>,
                  llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<2>>])>;
 
-  class AdvSIMD_3VectorArgIndexed_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_3VectorArgIndexed_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMMatchType<0>,
                  LLVMMatchType<0>,
                  llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<3>>])>;
 
-  class AdvSIMD_Pred1VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_Pred1VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  LLVMMatchType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_Pred2VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  LLVMMatchType<0>,
                  LLVMMatchType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_Pred3VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_Pred3VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  LLVMMatchType<0>,
                  LLVMMatchType<0>,
                  LLVMMatchType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_Compare_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
+  class Guarded_AdvSIMD_SVE_Compare_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  llvm_anyvector_ty,
                  LLVMMatchType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_CompareWide_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
+  class Guarded_AdvSIMD_SVE_CompareWide_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  llvm_anyvector_ty,
                  llvm_nxv2i64_ty],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_Saturating_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_Saturating_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  llvm_i32_ty,
                  llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>])>;
 
-  class AdvSIMD_SVE_Saturating_N_Intrinsic<LLVMType T, list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[T],
+  class Guarded_AdvSIMD_SVE_Saturating_N_Intrinsic<LLVMType T, list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[T],
                 [T, llvm_anyvector_ty],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<LLVMType T, list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[T],
+  class Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<LLVMType T, list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[T],
                 [T, llvm_i32_ty, llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>])>;
 
-  class AdvSIMD_SVE_CNT_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[LLVMVectorOfBitcastsToInt<0>],
+  class Guarded_AdvSIMD_SVE_CNT_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[LLVMVectorOfBitcastsToInt<0>],
                 [LLVMVectorOfBitcastsToInt<0>,
                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  llvm_anyvector_ty],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_ReduceWithInit_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[LLVMVectorElementType<0>],
+  class Guarded_AdvSIMD_SVE_ReduceWithInit_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[LLVMVectorElementType<0>],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  LLVMVectorElementType<0>,
                  llvm_anyvector_ty],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_ShiftByImm_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_ShiftByImm_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  LLVMMatchType<0>,
                  llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<2>>])>;
 
-  class AdvSIMD_SVE_ShiftWide_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_ShiftWide_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  LLVMMatchType<0>,
                  llvm_nxv2i64_ty],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_Unpack_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_Unpack_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                [LLVMSubdivide2VectorType<0>],
                !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_CADD_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_CADD_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  LLVMMatchType<0>,
                  LLVMMatchType<0>,
                  llvm_i32_ty],
                 [IntrNoMem, ImmArg<ArgIndex<3>>]>;
 
-  class AdvSIMD_SVE_CMLA_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_CMLA_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  LLVMMatchType<0>,
                  LLVMMatchType<0>,
@@ -1256,8 +1396,8 @@ let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
                  llvm_i32_ty],
                 [IntrNoMem, ImmArg<ArgIndex<4>>]>;
 
-  class AdvSIMD_SVE_CMLA_LANE_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_CMLA_LANE_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMMatchType<0>,
                  LLVMMatchType<0>,
@@ -1265,246 +1405,239 @@ let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
                  llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>])>;
 
-  class AdvSIMD_SVE_DUP_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_DUP_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  LLVMVectorElementType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_DUP_Unpred_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [LLVMVectorElementType<0>],
+  class Guarded_AdvSIMD_SVE_DUP_Unpred_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty], [LLVMVectorElementType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_DUPQ_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_DUPQ_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  llvm_i64_ty],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_EXPA_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_EXPA_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMVectorOfBitcastsToInt<0>],
                 [IntrNoMem]>;
 
-  class AdvSIMD_SVE_FCVT_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
-                [LLVMMatchType<0>,
-                 LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
-                 llvm_anyvector_ty],
-                [IntrNoMem]>;
-
-  class AdvSIMD_SVE_FCVTZS_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_FCVTZS_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMVectorOfBitcastsToInt<0>,
                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  llvm_anyvector_ty],
                 [IntrNoMem]>;
 
-  class AdvSIMD_SVE_INSR_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_INSR_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMVectorElementType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_PTRUE_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_PTRUE_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [llvm_i32_ty],
                 [IntrNoMem, ImmArg<ArgIndex<0>>]>;
 
-  class AdvSIMD_SVE_PUNPKHI_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[LLVMOneNthElementsVectorType<0, 2>],
+  class Guarded_AdvSIMD_SVE_PUNPKHI_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[LLVMOneNthElementsVectorType<0, 2>],
                 [llvm_anyvector_ty],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_SCALE_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_SCALE_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  LLVMMatchType<0>,
                  LLVMVectorOfBitcastsToInt<0>],
                 [IntrNoMem]>;
 
-  class AdvSIMD_SVE_SCVTF_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_SCVTF_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  llvm_anyvector_ty],
                 [IntrNoMem]>;
 
-  class AdvSIMD_SVE_TSMUL_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_TSMUL_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMVectorOfBitcastsToInt<0>],
                 [IntrNoMem]>;
 
-  class AdvSIMD_SVE_CNTB_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_i64_ty],
+  class Guarded_AdvSIMD_SVE_CNTB_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_i64_ty],
                 [llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<0>>])>;
 
-  class AdvSIMD_SVE_CNTP_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_i64_ty],
+  class Guarded_AdvSIMD_SVE_CNTP_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_i64_ty],
                 [llvm_anyvector_ty, LLVMMatchType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_DOT_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_DOT_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMSubdivide4VectorType<0>,
                  LLVMSubdivide4VectorType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_DOT_Indexed_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_DOT_Indexed_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMSubdivide4VectorType<0>,
                  LLVMSubdivide4VectorType<0>,
                  llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<3>>])>;
 
-  class AdvSIMD_SVE_PTEST_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_i1_ty],
+  class Guarded_AdvSIMD_SVE_PTEST_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_i1_ty],
                 [llvm_anyvector_ty,
                  LLVMMatchType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE_TBL_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_TBL_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMVectorOfBitcastsToInt<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class AdvSIMD_SVE2_TBX_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE2_TBX_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMMatchType<0>,
                  LLVMVectorOfBitcastsToInt<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class SVE2_LUTI_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    :  DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_LUTI_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    :  GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  llvm_nxv16i8_ty,
                  llvm_i32_ty],
                  !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<2>>])>;
 
-  class SVE2_LUTI_X2_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_LUTI_X2_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMMatchType<0>,
                  llvm_nxv16i8_ty,
                  llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<3>>])>;
 
-  class SVE2_LUTI6_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
+  class Guarded_SVE2_LUTI6_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_nxv16i8_ty],
                 [llvm_nxv16i8_ty,
                  llvm_nxv16i8_ty,
                  llvm_nxv16i8_ty],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class SVE2_1VectorArg_Long_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_1VectorArg_Long_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMSubdivide2VectorType<0>,
                  llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<1>>])>;
 
-  class SVE2_2VectorArg_Long_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_2VectorArg_Long_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMSubdivide2VectorType<0>,
                  LLVMSubdivide2VectorType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class SVE2_2VectorArgIndexed_Long_Intrinsic<list<IntrinsicProperty> Attrs = []>
-  : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_2VectorArgIndexed_Long_Intrinsic<list<IntrinsicProperty> Attrs = []>
+  : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
               [LLVMSubdivide2VectorType<0>,
                LLVMSubdivide2VectorType<0>,
                llvm_i32_ty],
               !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<2>>])>;
 
-  class SVE2_2VectorArg_Wide_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_2VectorArg_Wide_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMSubdivide2VectorType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class SVE2_2VectorArg_Pred_Long_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_2VectorArg_Pred_Long_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                  LLVMMatchType<0>,
                  LLVMSubdivide2VectorType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class SVE2_3VectorArg_Long_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_3VectorArg_Long_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMSubdivide2VectorType<0>,
                  LLVMSubdivide2VectorType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class SVE2_3VectorArgIndexed_Long_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_3VectorArgIndexed_Long_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMSubdivide2VectorType<0>,
                  LLVMSubdivide2VectorType<0>,
                  llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<3>>])>;
 
-  class SVE2_1VectorArg_Narrowing_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
+  class Guarded_SVE2_1VectorArg_Narrowing_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[LLVMSubdivide2VectorType<0>],
                 [llvm_anyvector_ty],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class SVE2_Merged1VectorArg_Narrowing_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
+  class Guarded_SVE2_Merged1VectorArg_Narrowing_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[LLVMSubdivide2VectorType<0>],
                 [LLVMSubdivide2VectorType<0>,
                  llvm_anyvector_ty],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class SVE2_2VectorArg_Narrowing_Intrinsic<list<IntrinsicProperty> Attrs = []>
-      : DefaultAttrsIntrinsic<
+  class Guarded_SVE2_2VectorArg_Narrowing_Intrinsic<list<IntrinsicProperty> Attrs = []>
+      : GuardedDefaultIntrinsic<
             [LLVMSubdivide2VectorType<0>],
             [llvm_anyvector_ty, LLVMMatchType<0>],
             !listconcat(Attrs, [IntrNoMem])>;
 
-  class SVE2_Merged2VectorArg_Narrowing_Intrinsic<list<IntrinsicProperty> Attrs = []>
-      : DefaultAttrsIntrinsic<
+  class Guarded_SVE2_Merged2VectorArg_Narrowing_Intrinsic<list<IntrinsicProperty> Attrs = []>
+      : GuardedDefaultIntrinsic<
             [LLVMSubdivide2VectorType<0>],
             [LLVMSubdivide2VectorType<0>, llvm_anyvector_ty, LLVMMatchType<0>],
             !listconcat(Attrs, [IntrNoMem])>;
 
-  class SVE2_1VectorArg_Imm_Narrowing_Intrinsic<list<IntrinsicProperty> Attrs = []>
-      : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
+  class Guarded_SVE2_1VectorArg_Imm_Narrowing_Intrinsic<list<IntrinsicProperty> Attrs = []>
+      : GuardedDefaultIntrinsic<[LLVMSubdivide2VectorType<0>],
                   [llvm_anyvector_ty, llvm_i32_ty],
                   !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<1>>])>;
 
-  class SVE2_2VectorArg_Imm_Narrowing_Intrinsic<list<IntrinsicProperty> Attrs = []>
-      : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
+  class Guarded_SVE2_2VectorArg_Imm_Narrowing_Intrinsic<list<IntrinsicProperty> Attrs = []>
+      : GuardedDefaultIntrinsic<[LLVMSubdivide2VectorType<0>],
                   [LLVMSubdivide2VectorType<0>, llvm_anyvector_ty,
                    llvm_i32_ty],
                   !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<2>>])>;
 
-  class SVE2_CONFLICT_DETECT_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_CONFLICT_DETECT_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [llvm_anyptr_ty, LLVMMatchType<1>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-  class SVE2_3VectorArg_Indexed_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_3VectorArg_Indexed_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMSubdivide2VectorType<0>,
                  LLVMSubdivide2VectorType<0>,
                  llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<3>>])>;
 
-  class SVE2_1VectorArgIndexed_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_1VectorArgIndexed_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<1>>])>;
 
-  class AdvSIMD_SVE_CDOT_LANE_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_AdvSIMD_SVE_CDOT_LANE_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>,
                  LLVMSubdivide4VectorType<0>,
                  LLVMSubdivide4VectorType<0>,
@@ -1512,37 +1645,37 @@ let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
                  llvm_i32_ty],
                 !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<3>>, ImmArg<ArgIndex<4>>])>;
 
-  class SVE2_1VectorArg_Pred_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
+  class Guarded_SVE2_1VectorArg_Pred_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
                             [llvm_anyvector_ty],
                             !listconcat(Attrs, [IntrNoMem])>;
 
-  class SVE2_1VectorArgIndexed_Pred_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
+  class Guarded_SVE2_1VectorArgIndexed_Pred_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
                             [llvm_anyvector_ty, llvm_i32_ty],
                             !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<1>>])>;
 
-  class SVE2_Pred_1VectorArgIndexed_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_Pred_1VectorArgIndexed_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                             [LLVMMatchType<0>,
                              LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_i32_ty],
                             !listconcat(Attrs, [IntrNoMem, ImmArg<ArgIndex<2>>])>;
 
-  class SVE2_Pred_1VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_Pred_1VectorArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                             [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>],
                             !listconcat(Attrs, [IntrNoMem])>;
 
   // NOTE: There is no relationship between these intrinsics beyond an attempt
   // to reuse currently identical class definitions.
-  class AdvSIMD_SVE_LOGB_Intrinsic : AdvSIMD_SVE_CNT_Intrinsic;
-  class AdvSIMD_SVE2_CADD_Intrinsic<list<IntrinsicProperty> Attrs = []> : AdvSIMD_2VectorArgIndexed_Intrinsic<Attrs>;
-  class AdvSIMD_SVE2_CMLA_Intrinsic<list<IntrinsicProperty> Attrs = []> : AdvSIMD_3VectorArgIndexed_Intrinsic<Attrs>;
+  class AdvSIMD_SVE_LOGB_Intrinsic : Guarded_AdvSIMD_SVE_CNT_Intrinsic;
+  class Guarded_AdvSIMD_SVE2_CADD_Intrinsic<list<IntrinsicProperty> Attrs = []> : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<Attrs>;
+  class Guarded_AdvSIMD_SVE2_CMLA_Intrinsic<list<IntrinsicProperty> Attrs = []> : Guarded_AdvSIMD_3VectorArgIndexed_Intrinsic<Attrs>;
 
   // This class of intrinsics are not intended to be useful within LLVM IR but
   // are instead here to support some of the more regid parts of the ACLE.
-  class Builtin_SVCVT<LLVMType OUT, LLVMType PRED, LLVMType IN>
-      : DefaultAttrsIntrinsic<[OUT], [OUT, PRED, IN], [IntrNoMem]>;
+  class Guarded_Builtin_SVCVT<LLVMType OUT, LLVMType PRED, LLVMType IN>
+      : GuardedDefaultIntrinsic<[OUT], [OUT, PRED, IN], [IntrNoMem]>;
 }
 
 //===----------------------------------------------------------------------===//
@@ -1550,42 +1683,41 @@ let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
 
 let TargetPrefix = "aarch64" in {  // All intrinsics start with "llvm.aarch64.".
 
-class AdvSIMD_SVE_2SVBoolArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
-  : DefaultAttrsIntrinsic<[llvm_nxv16i1_ty],
+class Guarded_AdvSIMD_SVE_2SVBoolArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
+  : GuardedDefaultIntrinsic<[llvm_nxv16i1_ty],
                           [llvm_nxv16i1_ty],
                           !listconcat(Attrs, [IntrNoMem])>;
 
-class AdvSIMD_SVE_3SVBoolArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
-  : DefaultAttrsIntrinsic<[llvm_nxv16i1_ty],
+class Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<list<IntrinsicProperty> Attrs = []>
+  : GuardedDefaultIntrinsic<[llvm_nxv16i1_ty],
                           [llvm_nxv16i1_ty, llvm_nxv16i1_ty],
                           !listconcat(Attrs, [IntrNoMem])>;
 
-class AdvSIMD_SVE_Reduce_Intrinsic<list<IntrinsicProperty> Attrs = []>
-  : DefaultAttrsIntrinsic<[LLVMVectorElementType<0>],
+class Guarded_AdvSIMD_SVE_Reduce_Intrinsic<list<IntrinsicProperty> Attrs = []>
+  : GuardedDefaultIntrinsic<[LLVMVectorElementType<0>],
               [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                llvm_anyvector_ty],
               !listconcat(Attrs, [IntrNoMem])>;
 
-class AdvSIMD_SVE_V128_Reduce_Intrinsic<list<IntrinsicProperty> Attrs = []>
-  : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+class Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic<list<IntrinsicProperty> Attrs = []>
+  : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
               [LLVMScalarOrSameVectorWidth<1, llvm_i1_ty>,
                llvm_anyvector_ty],
                !listconcat(Attrs, [IntrNoMem])>;
 
-
-class AdvSIMD_SVE_SADDV_Reduce_Intrinsic<list<IntrinsicProperty> Attrs = []>
-  : DefaultAttrsIntrinsic<[llvm_i64_ty],
+class Guarded_AdvSIMD_SVE_SADDV_Reduce_Intrinsic<list<IntrinsicProperty> Attrs = []>
+  : GuardedDefaultIntrinsic<[llvm_i64_ty],
               [LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                llvm_anyvector_ty],
               !listconcat(Attrs, [IntrNoMem])>;
 
-class AdvSIMD_SVE_WHILE_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+class Guarded_AdvSIMD_SVE_WHILE_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [llvm_anyint_ty, LLVMMatchType<1>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-class AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+class Guarded_AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [
                   LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                   llvm_anyptr_ty,
@@ -1593,8 +1725,8 @@ class AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic
                 ],
                 [IntrReadMem, IntrArgMemOnly]>;
 
-class AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+class Guarded_AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [
                   LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                   llvm_anyptr_ty,
@@ -1602,8 +1734,8 @@ class AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic
                 ],
                 [IntrRead<[ArgMem, FFR]>, IntrWrite<[FFR]>]>;
 
-class AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+class Guarded_AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [
                   LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                   llvm_anyptr_ty,
@@ -1611,8 +1743,8 @@ class AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic
                 ],
                 [IntrReadMem, IntrArgMemOnly]>;
 
-class AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+class Guarded_AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [
                   LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                   llvm_anyptr_ty,
@@ -1620,8 +1752,8 @@ class AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic
                 ],
                 [IntrRead<[ArgMem, FFR]>, IntrWrite<[FFR]>]>;
 
-class AdvSIMD_GatherLoad_VS_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+class Guarded_AdvSIMD_GatherLoad_VS_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [
                   LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                   llvm_anyvector_ty,
@@ -1629,8 +1761,8 @@ class AdvSIMD_GatherLoad_VS_Intrinsic
                 ],
                 [IntrReadMem]>;
 
-class AdvSIMD_GatherLoadQ_VS_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+class Guarded_AdvSIMD_GatherLoadQ_VS_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [
                   llvm_nxv1i1_ty,
                   llvm_anyvector_ty,
@@ -1638,8 +1770,8 @@ class AdvSIMD_GatherLoadQ_VS_Intrinsic
                 ],
                 [IntrReadMem]>;
 
-class AdvSIMD_GatherLoadQ_SV_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+class Guarded_AdvSIMD_GatherLoadQ_SV_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [
                   llvm_nxv1i1_ty,
                   llvm_anyptr_ty,
@@ -1647,8 +1779,8 @@ class AdvSIMD_GatherLoadQ_SV_Intrinsic
                 ],
                 [IntrReadMem, IntrArgMemOnly]>;
 
-class AdvSIMD_GatherLoad_VS_WriteFFR_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+class Guarded_AdvSIMD_GatherLoad_VS_WriteFFR_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [
                   LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
                   llvm_anyvector_ty,
@@ -1656,8 +1788,8 @@ class AdvSIMD_GatherLoad_VS_WriteFFR_Intrinsic
                 ],
                 [IntrRead<[ArgMem, FFR]>, IntrWrite<[FFR]>]>;
 
-class AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+class Guarded_AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                [
                  llvm_anyvector_ty,
                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
@@ -1666,8 +1798,8 @@ class AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic
                ],
                [IntrWriteMem, IntrArgMemOnly]>;
 
-class AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+class Guarded_AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                [
                  llvm_anyvector_ty,
                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
@@ -1676,8 +1808,8 @@ class AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic
                ],
                [IntrWriteMem, IntrArgMemOnly]>;
 
-class AdvSIMD_ScatterStore_VS_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+class Guarded_AdvSIMD_ScatterStore_VS_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                [
                  llvm_anyvector_ty,
                  LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
@@ -1685,8 +1817,8 @@ class AdvSIMD_ScatterStore_VS_Intrinsic
                ],
                [IntrWriteMem]>;
 
-class AdvSIMD_ScatterStoreQ_VS_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+class Guarded_AdvSIMD_ScatterStoreQ_VS_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                [
                  llvm_anyvector_ty,
                  llvm_nxv1i1_ty,
@@ -1695,8 +1827,8 @@ class AdvSIMD_ScatterStoreQ_VS_Intrinsic
                ],
                [IntrWriteMem]>;
 
-class AdvSIMD_ScatterStoreQ_SV_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+class Guarded_AdvSIMD_ScatterStoreQ_SV_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                [
                  llvm_anyvector_ty,
                  llvm_nxv1i1_ty,
@@ -1705,8 +1837,8 @@ class AdvSIMD_ScatterStoreQ_SV_Intrinsic
                ],
                [IntrWriteMem, IntrArgMemOnly]>;
 
-class SVE_gather_prf_SV
-    : DefaultAttrsIntrinsic<[],
+class Guarded_SVE_gather_prf_SV
+    : GuardedDefaultIntrinsic<[],
                 [
                   LLVMScalarOrSameVectorWidth<1, llvm_i1_ty>, // Predicate
                   llvm_anyptr_ty, // Base address
@@ -1715,8 +1847,8 @@ class SVE_gather_prf_SV
                 ],
                 [IntrInaccessibleMemOrArgMemOnly, NoCapture<ArgIndex<1>>, ImmArg<ArgIndex<3>>]>;
 
-class SVE_gather_prf_VS
-    : DefaultAttrsIntrinsic<[],
+class Guarded_SVE_gather_prf_VS
+    : GuardedDefaultIntrinsic<[],
                 [
                   LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, // Predicate
                   llvm_anyvector_ty, // Base addresses
@@ -1725,18 +1857,18 @@ class SVE_gather_prf_VS
                 ],
                 [IntrInaccessibleMemOrArgMemOnly, ImmArg<ArgIndex<3>>]>;
 
-class SVE_MatMul_Intrinsic<list<IntrinsicProperty> Attrs = []>
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+class Guarded_SVE_MatMul_Intrinsic<list<IntrinsicProperty> Attrs = []>
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                 [LLVMMatchType<0>, LLVMSubdivide4VectorType<0>, LLVMSubdivide4VectorType<0>],
                 !listconcat(Attrs, [IntrNoMem])>;
 
-class SVE_4Vec_BF16
-    : DefaultAttrsIntrinsic<[llvm_nxv4f32_ty],
+class Guarded_SVE_4Vec_BF16
+    : GuardedDefaultIntrinsic<[llvm_nxv4f32_ty],
                 [llvm_nxv4f32_ty, llvm_nxv8bf16_ty, llvm_nxv8bf16_ty],
                 [IntrNoMem]>;
 
-class SVE_4Vec_BF16_Indexed
-    : DefaultAttrsIntrinsic<[llvm_nxv4f32_ty],
+class Guarded_SVE_4Vec_BF16_Indexed
+    : GuardedDefaultIntrinsic<[llvm_nxv4f32_ty],
                 [llvm_nxv4f32_ty, llvm_nxv8bf16_ty, llvm_nxv8bf16_ty, llvm_i32_ty],
                 [IntrNoMem, ImmArg<ArgIndex<3>>]>;
 
@@ -1744,227 +1876,287 @@ class SVE_4Vec_BF16_Indexed
 // Loads
 //
 
-def int_aarch64_sve_ld1   : AdvSIMD_1Vec_PredLoad_Intrinsic;
+let TargetGuards = [Variant<"sve", "sme", DataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_ld1   : Guarded_AdvSIMD_1Vec_PredLoad_Intrinsic;
+}
 
-def int_aarch64_sve_ld2_sret : AdvSIMD_2Vec_PredLoad_Intrinsic;
-def int_aarch64_sve_ld3_sret : AdvSIMD_3Vec_PredLoad_Intrinsic;
-def int_aarch64_sve_ld4_sret : AdvSIMD_4Vec_PredLoad_Intrinsic;
+let TargetGuards = [Variant<"sve", "sme", PackedDataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_ldnt1 : Guarded_AdvSIMD_1Vec_PredLoad_Intrinsic;
 
-def int_aarch64_sve_ldnt1 : AdvSIMD_1Vec_PredLoad_Intrinsic;
-def int_aarch64_sve_ldnf1 : AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic;
-def int_aarch64_sve_ldff1 : AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic;
+  def int_aarch64_sve_ld2_sret : Guarded_AdvSIMD_2Vec_PredLoad_Intrinsic;
+  def int_aarch64_sve_ld3_sret : Guarded_AdvSIMD_3Vec_PredLoad_Intrinsic;
+  def int_aarch64_sve_ld4_sret : Guarded_AdvSIMD_4Vec_PredLoad_Intrinsic;
+  def int_aarch64_sve_ld1rq : Guarded_AdvSIMD_1Vec_PredLoad_Intrinsic;
+}
 
-def int_aarch64_sve_ld1rq : AdvSIMD_1Vec_PredLoad_Intrinsic;
-def int_aarch64_sve_ld1ro : AdvSIMD_1Vec_PredLoad_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_ldnf1 : Guarded_AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic;
+  def int_aarch64_sve_ldff1 : Guarded_AdvSIMD_1Vec_PredLoad_WriteFFR_Intrinsic;
+}
+
+let TargetGuards = [NonStreamingVariant<"f64mm", PackedDataPTR_OverloadPairs>] in
+def int_aarch64_sve_ld1ro : Guarded_AdvSIMD_1Vec_PredLoad_Intrinsic;
 
 //
 // Stores
 //
 
-def int_aarch64_sve_st1  : AdvSIMD_1Vec_PredStore_Intrinsic;
-def int_aarch64_sve_st2  : AdvSIMD_2Vec_PredStore_Intrinsic;
-def int_aarch64_sve_st3  : AdvSIMD_3Vec_PredStore_Intrinsic;
-def int_aarch64_sve_st4  : AdvSIMD_4Vec_PredStore_Intrinsic;
+let TargetGuards = [Variant<"sve", "sme", DataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_st1  : Guarded_AdvSIMD_1Vec_PredStore_Intrinsic;
+}
 
-def int_aarch64_sve_stnt1 : AdvSIMD_1Vec_PredStore_Intrinsic;
+let TargetGuards = [Variant<"sve", "sme", PackedDataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_stnt1 : Guarded_AdvSIMD_1Vec_PredStore_Intrinsic;
+
+  def int_aarch64_sve_st2  : Guarded_AdvSIMD_2Vec_PredStore_Intrinsic;
+  def int_aarch64_sve_st3  : Guarded_AdvSIMD_3Vec_PredStore_Intrinsic;
+  def int_aarch64_sve_st4  : Guarded_AdvSIMD_4Vec_PredStore_Intrinsic;
+}
 
 //
 // Prefetches
 //
 
+let TargetGuards = [Variant<"sve", "sme", PredicatePTR_OverloadPairs>] in
 def int_aarch64_sve_prf
-  : DefaultAttrsIntrinsic<[], [llvm_anyvector_ty, llvm_anyptr_ty, llvm_i32_ty],
+  : GuardedDefaultIntrinsic<[], [llvm_anyvector_ty, llvm_anyptr_ty, llvm_i32_ty],
                   [IntrArgMemOnly, ImmArg<ArgIndex<2>>]>;
 
+defvar PointerAndI32_Overloads = [
+  [llvm_ptr_ty, llvm_nxv4i32_ty],
+  [llvm_ptr_ty, LLVMType<nxv2i32>]
+];
+
 // Scalar + 32-bit scaled offset vector, zero extend, packed and
 // unpacked.
-def int_aarch64_sve_prfb_gather_uxtw_index : SVE_gather_prf_SV;
-def int_aarch64_sve_prfh_gather_uxtw_index : SVE_gather_prf_SV;
-def int_aarch64_sve_prfw_gather_uxtw_index : SVE_gather_prf_SV;
-def int_aarch64_sve_prfd_gather_uxtw_index : SVE_gather_prf_SV;
+let TargetGuards = [NonStreamingVariant<"sve", PointerAndI32_Overloads>] in {
+  def int_aarch64_sve_prfb_gather_uxtw_index : Guarded_SVE_gather_prf_SV;
+  def int_aarch64_sve_prfh_gather_uxtw_index : Guarded_SVE_gather_prf_SV;
+  def int_aarch64_sve_prfw_gather_uxtw_index : Guarded_SVE_gather_prf_SV;
+  def int_aarch64_sve_prfd_gather_uxtw_index : Guarded_SVE_gather_prf_SV;
+}
 
 // Scalar + 32-bit scaled offset vector, sign extend, packed and
 // unpacked.
-def int_aarch64_sve_prfb_gather_sxtw_index : SVE_gather_prf_SV;
-def int_aarch64_sve_prfw_gather_sxtw_index : SVE_gather_prf_SV;
-def int_aarch64_sve_prfh_gather_sxtw_index : SVE_gather_prf_SV;
-def int_aarch64_sve_prfd_gather_sxtw_index : SVE_gather_prf_SV;
+let TargetGuards = [NonStreamingVariant<"sve", PointerAndI32_Overloads>] in {
+  def int_aarch64_sve_prfb_gather_sxtw_index : Guarded_SVE_gather_prf_SV;
+  def int_aarch64_sve_prfw_gather_sxtw_index : Guarded_SVE_gather_prf_SV;
+  def int_aarch64_sve_prfh_gather_sxtw_index : Guarded_SVE_gather_prf_SV;
+  def int_aarch64_sve_prfd_gather_sxtw_index : Guarded_SVE_gather_prf_SV;
+}
+
+defvar PointerAndI64_Overloads = [
+  [llvm_ptr_ty, llvm_nxv2i64_ty]
+];
 
 // Scalar + 64-bit scaled offset vector.
-def int_aarch64_sve_prfb_gather_index : SVE_gather_prf_SV;
-def int_aarch64_sve_prfh_gather_index : SVE_gather_prf_SV;
-def int_aarch64_sve_prfw_gather_index : SVE_gather_prf_SV;
-def int_aarch64_sve_prfd_gather_index : SVE_gather_prf_SV;
+let TargetGuards = [NonStreamingVariant<"sve", PointerAndI64_Overloads>] in {
+  def int_aarch64_sve_prfb_gather_index : Guarded_SVE_gather_prf_SV;
+  def int_aarch64_sve_prfh_gather_index : Guarded_SVE_gather_prf_SV;
+  def int_aarch64_sve_prfw_gather_index : Guarded_SVE_gather_prf_SV;
+  def int_aarch64_sve_prfd_gather_index : Guarded_SVE_gather_prf_SV;
+}
 
 // Vector + scalar.
-def int_aarch64_sve_prfb_gather_scalar_offset : SVE_gather_prf_VS;
-def int_aarch64_sve_prfh_gather_scalar_offset : SVE_gather_prf_VS;
-def int_aarch64_sve_prfw_gather_scalar_offset : SVE_gather_prf_VS;
-def int_aarch64_sve_prfd_gather_scalar_offset : SVE_gather_prf_VS;
+let TargetGuards = [NonStreamingVariant<"sve", I32_I64_Overloads>] in {
+  def int_aarch64_sve_prfb_gather_scalar_offset : Guarded_SVE_gather_prf_VS;
+  def int_aarch64_sve_prfh_gather_scalar_offset : Guarded_SVE_gather_prf_VS;
+  def int_aarch64_sve_prfw_gather_scalar_offset : Guarded_SVE_gather_prf_VS;
+  def int_aarch64_sve_prfd_gather_scalar_offset : Guarded_SVE_gather_prf_VS;
+}
 
 //
 // Scalar to vector operations
 //
 
-def int_aarch64_sve_dup : AdvSIMD_SVE_DUP_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_dup_x : AdvSIMD_SVE_DUP_Unpred_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", AllPackedData_Overloads>] in {
+  def int_aarch64_sve_dup : Guarded_AdvSIMD_SVE_DUP_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_dup_x : Guarded_AdvSIMD_SVE_DUP_Unpred_Intrinsic<[IntrSpeculatable]>;
+}
 
-def int_aarch64_sve_index : AdvSIMD_SVE_Index_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I8_I16_I32_I64_Overloads>] in
+def int_aarch64_sve_index : Guarded_AdvSIMD_SVE_Index_Intrinsic<[IntrSpeculatable]>;
 
 //
 // Address calculation
 //
 
-def int_aarch64_sve_adrb : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_adrh : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_adrw : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_adrd : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [NonStreamingVariant<"sve", I32_I64_Overloads>] in {
+  def int_aarch64_sve_adrb : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_adrh : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_adrw : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_adrd : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // Integer arithmetic
 //
 
-def int_aarch64_sve_add   : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_add_u : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sub   : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sub_u : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_subr  : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_pmul       : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_mul        : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_mul_u      : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_mul_lane   : AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smulh      : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smulh_u    : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umulh      : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umulh_u    : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_sdiv       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sdiv_u     : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_udiv       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_udiv_u     : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sdivr      : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_udivr      : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_smax       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smax_u     : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umax       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umax_u     : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smin       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smin_u     : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umin       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umin_u     : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sabd       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sabd_u     : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uabd       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uabd_u     : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_mad        : AdvSIMD_Pred3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_msb        : AdvSIMD_Pred3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_mla        : AdvSIMD_Pred3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_mla_u      : AdvSIMD_Pred3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_mla_lane   : AdvSIMD_3VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_mls        : AdvSIMD_Pred3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_mls_u      : AdvSIMD_Pred3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_mls_lane   : AdvSIMD_3VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_saddv      : AdvSIMD_SVE_SADDV_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uaddv      : AdvSIMD_SVE_SADDV_Reduce_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_smaxv      : AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umaxv      : AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sminv      : AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uminv      : AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_orv        : AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_eorv       : AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_andv       : AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_abs : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_neg : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_sdot      : AdvSIMD_SVE_DOT_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sdot_lane : AdvSIMD_SVE_DOT_Indexed_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_udot      : AdvSIMD_SVE_DOT_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_udot_lane : AdvSIMD_SVE_DOT_Indexed_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_sqadd_x   : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqsub_x   : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqadd_x   : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqsub_x   : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_orqv      : AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_eorqv     : AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_andqv     : AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_addqv     : AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smaxqv    : AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umaxqv    : AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sminqv    : AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uminqv    : AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_add   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_add_u : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sub   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sub_u : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_subr  : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_mul        : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_mul_u      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smulh      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smulh_u    : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umulh      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umulh_u    : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smax       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smax_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umax       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umax_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smin       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smin_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umin       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umin_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sabd       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sabd_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uabd       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uabd_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_mad        : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_msb        : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_mla        : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_mla_u      : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_mls        : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_mls_u      : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_saddv      : Guarded_AdvSIMD_SVE_SADDV_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uaddv      : Guarded_AdvSIMD_SVE_SADDV_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smaxv      : Guarded_AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umaxv      : Guarded_AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sminv      : Guarded_AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uminv      : Guarded_AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_orv        : Guarded_AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_eorv       : Guarded_AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_andv       : Guarded_AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_abs : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_neg : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqadd_x   : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqsub_x   : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqadd_x   : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqsub_x   : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I8_Overloads>] in
+def int_aarch64_sve_pmul       : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_mul_lane   : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_mla_lane   : Guarded_AdvSIMD_3VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_mls_lane   : Guarded_AdvSIMD_3VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve", "sme", I32_I64_Overloads>] in {
+  def int_aarch64_sve_sdiv       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sdiv_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_udiv       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_udiv_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sdivr      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_udivr      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sdot      : Guarded_AdvSIMD_SVE_DOT_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sdot_lane : Guarded_AdvSIMD_SVE_DOT_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_udot      : Guarded_AdvSIMD_SVE_DOT_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_udot_lane : Guarded_AdvSIMD_SVE_DOT_Indexed_Intrinsic<[IntrSpeculatable]>;
+}
+
+defvar SveOrqvTypes = [
+  [llvm_v16i8_ty, llvm_nxv16i8_ty],
+  [llvm_v2i64_ty, llvm_nxv2i64_ty],
+  [llvm_v4i32_ty, llvm_nxv4i32_ty],
+  [llvm_v8i16_ty, llvm_nxv8i16_ty],
+];
+let TargetGuards = [Variant<"sve,(sve2p1|sme2p1)", "sve2p1|sme2p1", SveOrqvTypes>] in {
+  def int_aarch64_sve_orqv      : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_eorqv     : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_andqv     : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_addqv     : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smaxqv    : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umaxqv    : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sminqv    : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uminqv    : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic<[IntrSpeculatable]>;
+}
 
 // Shifts
 
-def int_aarch64_sve_asr      : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_asr_u    : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_asr_wide : AdvSIMD_SVE_ShiftWide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_asrd     : AdvSIMD_SVE_ShiftByImm_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_insr     : AdvSIMD_SVE_INSR_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_lsl      : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_lsl_u    : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_lsl_wide : AdvSIMD_SVE_ShiftWide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_lsr      : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_lsr_u    : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_lsr_wide : AdvSIMD_SVE_ShiftWide_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_asr      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_asr_u    : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_asrd     : Guarded_AdvSIMD_SVE_ShiftByImm_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_lsl      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_lsl_u    : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_lsr      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_lsr_u    : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve", "sme", I8_I16_I32_Overloads>] in {
+  def int_aarch64_sve_asr_wide : Guarded_AdvSIMD_SVE_ShiftWide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_lsl_wide : Guarded_AdvSIMD_SVE_ShiftWide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_lsr_wide : Guarded_AdvSIMD_SVE_ShiftWide_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve", "sme", AllPackedData_Overloads>] in
+def int_aarch64_sve_insr     : Guarded_AdvSIMD_SVE_INSR_Intrinsic<[IntrSpeculatable]>;
 
 //
 // Integer comparisons
 //
 
-def int_aarch64_sve_cmpeq : AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmpge : AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmpgt : AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmphi : AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmphs : AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmpne : AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_cmpeq : Guarded_AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmpge : Guarded_AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmpgt : Guarded_AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmphi : Guarded_AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmphs : Guarded_AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmpne : Guarded_AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
+}
 
-def int_aarch64_sve_cmpeq_wide : AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmpge_wide : AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmpgt_wide : AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmphi_wide : AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmphs_wide : AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmple_wide : AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmplo_wide : AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmpls_wide : AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmplt_wide : AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmpne_wide : AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I8_I16_I32_Overloads>] in {
+  def int_aarch64_sve_cmpeq_wide : Guarded_AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmpge_wide : Guarded_AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmpgt_wide : Guarded_AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmphi_wide : Guarded_AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmphs_wide : Guarded_AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmple_wide : Guarded_AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmplo_wide : Guarded_AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmpls_wide : Guarded_AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmplt_wide : Guarded_AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmpne_wide : Guarded_AdvSIMD_SVE_CompareWide_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // Counting bits
 //
 
-def int_aarch64_sve_cls : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_clz : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cnt : AdvSIMD_SVE_CNT_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_cls : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_clz : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
+let TargetGuards = [Variant<"sve", "sme", AllPackedData_Overloads>] in
+def int_aarch64_sve_cnt : Guarded_AdvSIMD_SVE_CNT_Intrinsic<[IntrSpeculatable]>;
 
 //
 // Counting elements
 //
 
-def int_aarch64_sve_cntb : AdvSIMD_SVE_CNTB_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cnth : AdvSIMD_SVE_CNTB_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cntw : AdvSIMD_SVE_CNTB_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cntd : AdvSIMD_SVE_CNTB_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", EmptyOverload>] in {
+  def int_aarch64_sve_cntb : Guarded_AdvSIMD_SVE_CNTB_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cnth : Guarded_AdvSIMD_SVE_CNTB_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cntw : Guarded_AdvSIMD_SVE_CNTB_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cntd : Guarded_AdvSIMD_SVE_CNTB_Intrinsic<[IntrSpeculatable]>;
+}
 
-def int_aarch64_sve_cntp : AdvSIMD_SVE_CNTP_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_firstp : AdvSIMD_SVE_CNTP_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_lastp  : AdvSIMD_SVE_CNTP_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2p2|sme2p2)", "sve2p2|sme2p2", Predicate_Overloads>] in {
+  def int_aarch64_sve_firstp : Guarded_AdvSIMD_SVE_CNTP_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_lastp  : Guarded_AdvSIMD_SVE_CNTP_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // FFR manipulation
 //
 
+// FIXME: Add target guards
 def int_aarch64_sve_rdffr   : ClangBuiltin<"__builtin_sve_svrdffr">,   DefaultAttrsIntrinsic<[llvm_nxv16i1_ty], [], [IntrRead<[FFR]>, IntrReadOnly]>;
 def int_aarch64_sve_rdffr_z : ClangBuiltin<"__builtin_sve_svrdffr_z">, DefaultAttrsIntrinsic<[llvm_nxv16i1_ty], [llvm_nxv16i1_ty], [IntrRead<[FFR]>, IntrReadOnly]>;
 def int_aarch64_sve_setffr  : ClangBuiltin<"__builtin_sve_svsetffr">,  DefaultAttrsIntrinsic<[], [], [IntrWrite<[FFR]>, IntrWriteOnly]>;
@@ -1974,911 +2166,1189 @@ def int_aarch64_sve_wrffr   : ClangBuiltin<"__builtin_sve_svwrffr">,   DefaultAt
 // Saturating scalar arithmetic
 //
 
-def int_aarch64_sve_sqdech : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdecw : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdecd : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdecp : AdvSIMD_SVE_Saturating_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_sqdecb_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqdecb_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqdech_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqdech_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqdecw_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqdecw_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqdecd_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqdecd_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqdecp_n32 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqdecp_n64 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-
-def int_aarch64_sve_sqinch : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqincw : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqincd : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqincp : AdvSIMD_SVE_Saturating_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_sqincb_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqincb_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqinch_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqinch_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqincw_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqincw_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqincd_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqincd_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqincp_n32 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_sqincp_n64 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-
-def int_aarch64_sve_uqdech : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqdecw : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqdecd : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqdecp : AdvSIMD_SVE_Saturating_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_uqdecb_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqdecb_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqdech_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqdech_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqdecw_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqdecw_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqdecd_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqdecd_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqdecp_n32 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqdecp_n64 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-
-def int_aarch64_sve_uqinch : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqincw : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqincd : AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqincp : AdvSIMD_SVE_Saturating_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_uqincb_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqincb_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqinch_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqinch_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqincw_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqincw_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqincd_n32 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqincd_n64 : AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqincp_n32 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
-def int_aarch64_sve_uqincp_n64 : AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I16_Overloads>] in {
+  def int_aarch64_sve_sqdech : Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqinch : Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqdech : Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqinch : Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve", "sme", I32_Overloads>] in {
+  def int_aarch64_sve_sqdecw : Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqincw : Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqdecw : Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqincw : Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve", "sme", I64_Overloads>] in {
+  def int_aarch64_sve_sqdecd : Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqincd : Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqdecd : Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqincd : Guarded_AdvSIMD_SVE_SaturatingWithPattern_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_sqdecp : Guarded_AdvSIMD_SVE_Saturating_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqincp : Guarded_AdvSIMD_SVE_Saturating_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqdecp : Guarded_AdvSIMD_SVE_Saturating_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqincp : Guarded_AdvSIMD_SVE_Saturating_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve", "sme", EmptyOverload>] in {
+  def int_aarch64_sve_sqdecb_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqdecb_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqdech_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqdech_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqdecw_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqdecw_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqdecd_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqdecd_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqincb_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqincb_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqinch_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqinch_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqincw_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqincw_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqincd_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqincd_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqdecb_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqdecb_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqdech_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqdech_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqdecw_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqdecw_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqdecd_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqdecd_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqincb_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqincb_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqinch_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqinch_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqincw_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqincw_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqincd_n32 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqincd_n64 : Guarded_AdvSIMD_SVE_SaturatingWithPattern_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+}
 
 //
 // Reversal
 //
 
-def int_aarch64_sve_rbit : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_revb : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_revh : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_revw : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I8_I16_I32_I64_Overloads>] in
+def int_aarch64_sve_rbit : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I16_I32_I64_Overloads>] in
+def int_aarch64_sve_revb : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I32_I64_Overloads>] in
+def int_aarch64_sve_revh : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I64_Overloads>] in
+def int_aarch64_sve_revw : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
 
 //
 // Permutations and selection
 //
 
-def int_aarch64_sve_clasta    : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_clasta_n  : AdvSIMD_SVE_ReduceWithInit_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_clastb    : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_clastb_n  : AdvSIMD_SVE_ReduceWithInit_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_compact   : AdvSIMD_Pred1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_expand    : AdvSIMD_Pred1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_dupq_lane : AdvSIMD_SVE_DUPQ_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_dup_laneq : SVE2_1VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ext       : AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sel       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_lasta     : AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_lastb     : AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_rev_b16   : AdvSIMD_SVE_2SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_rev_b32   : AdvSIMD_SVE_2SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_rev_b64   : AdvSIMD_SVE_2SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_splice    : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sunpkhi   : AdvSIMD_SVE_Unpack_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sunpklo   : AdvSIMD_SVE_Unpack_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_tbl       : AdvSIMD_SVE_TBL_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_trn1      : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_trn1_b16  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_trn1_b32  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_trn1_b64  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_trn2      : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_trn2_b16  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_trn2_b32  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_trn2_b64  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_trn1q     : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_trn2q     : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uunpkhi   : AdvSIMD_SVE_Unpack_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uunpklo   : AdvSIMD_SVE_Unpack_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uzp1      : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uzp1_b16  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uzp1_b32  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uzp1_b64  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uzp2      : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uzp2_b16  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uzp2_b32  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uzp2_b64  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uzp1q     : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uzp2q     : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_zip1      : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_zip1_b16  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_zip1_b32  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_zip1_b64  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_zip2      : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_zip2_b16  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_zip2_b32  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_zip2_b64  : AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_zip1q     : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_zip2q     : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", AllPackedData_Overloads>] in {
+  def int_aarch64_sve_clasta    : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_clasta_n  : Guarded_AdvSIMD_SVE_ReduceWithInit_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_clastb    : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_clastb_n  : Guarded_AdvSIMD_SVE_ReduceWithInit_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_dupq_lane : Guarded_AdvSIMD_SVE_DUPQ_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ext       : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_lasta     : Guarded_AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_lastb     : Guarded_AdvSIMD_SVE_Reduce_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_splice    : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_tbl       : Guarded_AdvSIMD_SVE_TBL_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [
+  Variant<"sve", "sme2p2", I32_I64_F32_F64_Overloads>,
+  Variant<"sve,(sve2p2|sme2p2)", "sme2p2", I8_I16_BF16_F16_Overloads>,
+] in
+def int_aarch64_sve_compact   : Guarded_AdvSIMD_Pred1VectorArg_Intrinsic<[IntrSpeculatable]>;
+
+let TargetGuards = [Variant<"sve,(sve2p2|sme2p2)", "sme2p2", AllPackedData_Overloads>] in
+def int_aarch64_sve_expand    : Guarded_AdvSIMD_Pred1VectorArg_Intrinsic<[IntrSpeculatable]>;
+
+let TargetGuards = [Variant<"sve,(sve2p1|sme2p1)", "sve2p1|sme2p1", AllPackedData_Overloads>] in
+def int_aarch64_sve_dup_laneq : Guarded_SVE2_1VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+
+let TargetGuards = [Variant<"sve", "sme", !listconcat([[llvm_nxv16i1_ty]], AllPackedData_Overloads)>] in {
+  def int_aarch64_sve_sel       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_trn1      : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_trn2      : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uzp1      : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uzp2      : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_zip1      : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_zip2      : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve", "sme", EmptyOverload>] in {
+  def int_aarch64_sve_rev_b16   : Guarded_AdvSIMD_SVE_2SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_rev_b32   : Guarded_AdvSIMD_SVE_2SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_rev_b64   : Guarded_AdvSIMD_SVE_2SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_trn1_b16  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_trn1_b32  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_trn1_b64  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_trn2_b16  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_trn2_b32  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_trn2_b64  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uzp1_b16  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uzp1_b32  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uzp1_b64  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uzp2_b16  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uzp2_b32  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uzp2_b64  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_zip1_b16  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_zip1_b32  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_zip1_b64  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_zip2_b16  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_zip2_b32  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_zip2_b64  : Guarded_AdvSIMD_SVE_3SVBoolArg_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_sunpkhi   : Guarded_AdvSIMD_SVE_Unpack_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sunpklo   : Guarded_AdvSIMD_SVE_Unpack_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uunpkhi   : Guarded_AdvSIMD_SVE_Unpack_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uunpklo   : Guarded_AdvSIMD_SVE_Unpack_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [NonStreamingVariant<"f64mm", AllPackedData_Overloads>] in {
+  def int_aarch64_sve_trn1q     : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_trn2q     : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uzp1q     : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uzp2q     : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_zip1q     : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_zip2q     : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // Logical operations
 //
 
-def int_aarch64_sve_and  : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_and_u: AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_bic  : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_bic_u: AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cnot : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_eor  : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_eor_u: AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_not  : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_orr  : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_orr_u: AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_and  : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_and_u: Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_bic  : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_bic_u: Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cnot : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_eor  : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_eor_u: Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_not  : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_orr  : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_orr_u: Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // Conversion
 //
 
-def int_aarch64_sve_sxtb : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sxth : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sxtw : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uxtb : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uxth : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uxtw : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_sxtb : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uxtb : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve", "sme", I32_I64_Overloads>] in {
+  def int_aarch64_sve_sxth : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uxth : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve", "sme", I64_Overloads>] in {
+  def int_aarch64_sve_sxtw : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uxtw : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // While comparisons
 //
 
-def int_aarch64_sve_whilele : AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilelo : AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilels : AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilelt : AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilege : AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilegt : AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilehs : AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilehi : AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
+defvar PredicateAndIntegerScalarTypes = [
+  [llvm_nxv2i1_ty, llvm_i32_ty],
+  [llvm_nxv4i1_ty, llvm_i32_ty],
+  [llvm_nxv8i1_ty, llvm_i32_ty],
+  [llvm_nxv16i1_ty, llvm_i32_ty],
+  [llvm_nxv2i1_ty, llvm_i64_ty],
+  [llvm_nxv4i1_ty, llvm_i64_ty],
+  [llvm_nxv8i1_ty, llvm_i64_ty],
+  [llvm_nxv16i1_ty, llvm_i64_ty]
+];
+
+let TargetGuards = [Variant<"sve", "sme", PredicateAndIntegerScalarTypes>] in {
+  def int_aarch64_sve_whilele : Guarded_AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilelo : Guarded_AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilels : Guarded_AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilelt : Guarded_AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
+}
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", PredicateAndIntegerScalarTypes>] in {
+  def int_aarch64_sve_whilege : Guarded_AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilegt : Guarded_AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilehs : Guarded_AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilehi : Guarded_AdvSIMD_SVE_WHILE_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // Floating-point arithmetic
 //
 
-def int_aarch64_sve_fabd       : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fabd_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fabs       : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_fadd       : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fadd_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fcadd      : AdvSIMD_SVE_CADD_Intrinsic;
-def int_aarch64_sve_fcmla      : AdvSIMD_SVE_CMLA_Intrinsic;
-def int_aarch64_sve_fcmla_lane : AdvSIMD_SVE_CMLA_LANE_Intrinsic;
-def int_aarch64_sve_fdiv       : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fdiv_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fdivr      : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fexpa_x    : AdvSIMD_SVE_EXPA_Intrinsic;
-def int_aarch64_sve_fmad       : AdvSIMD_Pred3VectorArg_Intrinsic;
-def int_aarch64_sve_fmax       : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fmax_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fmaxnm     : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fmaxnm_u   : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fmin       : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fmin_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fminnm     : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fminnm_u   : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fmla       : AdvSIMD_Pred3VectorArg_Intrinsic;
-def int_aarch64_sve_fmla_lane  : AdvSIMD_3VectorArgIndexed_Intrinsic;
-def int_aarch64_sve_fmla_u     : AdvSIMD_Pred3VectorArg_Intrinsic;
-def int_aarch64_sve_fmls       : AdvSIMD_Pred3VectorArg_Intrinsic;
-def int_aarch64_sve_fmls_lane  : AdvSIMD_3VectorArgIndexed_Intrinsic;
-def int_aarch64_sve_fmls_u     : AdvSIMD_Pred3VectorArg_Intrinsic;
-def int_aarch64_sve_fmsb       : AdvSIMD_Pred3VectorArg_Intrinsic;
-def int_aarch64_sve_fmul       : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fmul_lane  : AdvSIMD_2VectorArgIndexed_Intrinsic;
-def int_aarch64_sve_fmul_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fmulx      : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fmulx_u    : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fneg       : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_fnmad      : AdvSIMD_Pred3VectorArg_Intrinsic;
-def int_aarch64_sve_fnmla      : AdvSIMD_Pred3VectorArg_Intrinsic;
-def int_aarch64_sve_fnmla_u    : AdvSIMD_Pred3VectorArg_Intrinsic;
-def int_aarch64_sve_fnmls      : AdvSIMD_Pred3VectorArg_Intrinsic;
-def int_aarch64_sve_fnmls_u    : AdvSIMD_Pred3VectorArg_Intrinsic;
-def int_aarch64_sve_fnmsb      : AdvSIMD_Pred3VectorArg_Intrinsic;
-def int_aarch64_sve_frecpe_x   : AdvSIMD_1VectorArg_Intrinsic;
-def int_aarch64_sve_frecps_x   : AdvSIMD_2VectorArg_Intrinsic;
-def int_aarch64_sve_frecpx     : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_frinta     : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_frinti     : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_frintm     : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_frintn     : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_frintp     : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_frintx     : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_frintz     : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_frint32x   : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_frint32z   : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_frint64x   : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_frint64z   : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_frsqrte_x  : AdvSIMD_1VectorArg_Intrinsic;
-def int_aarch64_sve_frsqrts_x  : AdvSIMD_2VectorArg_Intrinsic;
-def int_aarch64_sve_fscale     : AdvSIMD_SVE_SCALE_Intrinsic;
-def int_aarch64_sve_fsqrt      : AdvSIMD_Merged1VectorArg_Intrinsic;
-def int_aarch64_sve_fsub       : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fsub_u     : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fsubr      : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_ftmad_x    : AdvSIMD_2VectorArgIndexed_Intrinsic;
-def int_aarch64_sve_ftsmul_x   : AdvSIMD_SVE_TSMUL_Intrinsic;
-def int_aarch64_sve_ftssel_x   : AdvSIMD_SVE_TSMUL_Intrinsic;
+let TargetGuards = [Variant<"sve", "sme", !listconcat(BF16_Overloads, F16_F32_F64_Overloads)>] in {
+  // The following intrinsics may equally work on bfloat types,
+  // hence no '+bf16' required on the tests.
+  //
+  // FIXME: Lock this list down further, as not all intrinsics
+  // support bfloat types.
+  def int_aarch64_sve_fabd       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fabd_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fabs       : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_fcadd      : Guarded_AdvSIMD_SVE_CADD_Intrinsic;
+  def int_aarch64_sve_fcmla      : Guarded_AdvSIMD_SVE_CMLA_Intrinsic;
+  def int_aarch64_sve_fdiv       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fdiv_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fdivr      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fmad       : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic;
+  def int_aarch64_sve_fmsb       : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic;
+  def int_aarch64_sve_fmulx      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fmulx_u    : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fneg       : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_fnmad      : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic;
+  def int_aarch64_sve_fnmla      : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic;
+  def int_aarch64_sve_fnmla_u    : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic;
+  def int_aarch64_sve_fnmls      : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic;
+  def int_aarch64_sve_fnmls_u    : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic;
+  def int_aarch64_sve_fnmsb      : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic;
+  def int_aarch64_sve_frecpe_x   : Guarded_AdvSIMD_1VectorArg_Intrinsic;
+  def int_aarch64_sve_frecps_x   : Guarded_AdvSIMD_2VectorArg_Intrinsic;
+  def int_aarch64_sve_frecpx     : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_frinta     : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_frinti     : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_frintm     : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_frintn     : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_frintp     : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_frintx     : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_frintz     : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_frsqrte_x  : Guarded_AdvSIMD_1VectorArg_Intrinsic;
+  def int_aarch64_sve_frsqrts_x  : Guarded_AdvSIMD_2VectorArg_Intrinsic;
+  def int_aarch64_sve_fsqrt      : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_fsubr      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+}
 
-//
-// Floating-point reductions
-//
+let TargetGuards = [
+  Variant<"sve,sve-b16b16", "sme2,sve-b16b16", BF16_Overloads>,
+  Variant<"sve", "sme", F16_F32_F64_Overloads>,
+] in
+def int_aarch64_sve_fadd       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+
+let TargetGuards = [
+  Variant<"sve", "sme", F32_F64_Overloads>,
+  Variant<"sve,sve-b16b16", "sme2,sve-b16b16", BF16_Overloads>,
+  Variant<"sve", "sme", F16_Overloads>,
+] in {
+  def int_aarch64_sve_fadd_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fmax       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fmax_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fmaxnm     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fmaxnm_u   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fmin       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fmin_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fminnm     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fminnm_u   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fmla       : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic;
+  def int_aarch64_sve_fmla_lane  : Guarded_AdvSIMD_3VectorArgIndexed_Intrinsic;
+  def int_aarch64_sve_fmla_u     : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic;
+  def int_aarch64_sve_fmls       : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic;
+  def int_aarch64_sve_fmls_lane  : Guarded_AdvSIMD_3VectorArgIndexed_Intrinsic;
+  def int_aarch64_sve_fmls_u     : Guarded_AdvSIMD_Pred3VectorArg_Intrinsic;
+  def int_aarch64_sve_fmul       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fmul_lane  : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic;
+  def int_aarch64_sve_fmul_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fsub       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fsub_u     : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+}
+
+let TargetGuards = [Variant<"sve", "sme", F16_F32_Overloads>] in
+def int_aarch64_sve_fcmla_lane : Guarded_AdvSIMD_SVE_CMLA_LANE_Intrinsic;
 
-def int_aarch64_sve_fadda   : AdvSIMD_SVE_ReduceWithInit_Intrinsic;
-def int_aarch64_sve_faddv   : AdvSIMD_SVE_Reduce_Intrinsic;
-def int_aarch64_sve_fmaxv   : AdvSIMD_SVE_Reduce_Intrinsic;
-def int_aarch64_sve_fmaxnmv : AdvSIMD_SVE_Reduce_Intrinsic;
-def int_aarch64_sve_fminv   : AdvSIMD_SVE_Reduce_Intrinsic;
-def int_aarch64_sve_fminnmv : AdvSIMD_SVE_Reduce_Intrinsic;
+let TargetGuards = [Variant<"sve", "sme2,ssve-fexpa", F16_F32_F64_Overloads>] in
+def int_aarch64_sve_fexpa_x    : Guarded_AdvSIMD_SVE_EXPA_Intrinsic;
 
-def int_aarch64_sve_faddqv   : AdvSIMD_SVE_V128_Reduce_Intrinsic;
-def int_aarch64_sve_fmaxnmqv : AdvSIMD_SVE_V128_Reduce_Intrinsic;
-def int_aarch64_sve_fminnmqv : AdvSIMD_SVE_V128_Reduce_Intrinsic;
-def int_aarch64_sve_fmaxqv   : AdvSIMD_SVE_V128_Reduce_Intrinsic;
-def int_aarch64_sve_fminqv   : AdvSIMD_SVE_V128_Reduce_Intrinsic;
+let TargetGuards = [Variant<"sve,(sve2p2|sme2p2)", "sve2p2|sme2p2", F32_F64_Overloads>] in {
+  def int_aarch64_sve_frint32x   : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_frint32z   : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_frint64x   : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+  def int_aarch64_sve_frint64z   : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic;
+}
+
+let TargetGuards = [
+  Variant<"sve", "sme", F32_F64_Overloads>,
+  Variant<"sve,sve-bfscale", "sve-bfscale,sme2", BF16_Overloads>,
+  Variant<"sve", "sme", F16_Overloads>,
+] in
+def int_aarch64_sve_fscale     : Guarded_AdvSIMD_SVE_SCALE_Intrinsic;
+
+let TargetGuards = [NonStreamingVariant<"sve", F16_F32_F64_Overloads>] in {
+  def int_aarch64_sve_ftmad_x    : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic;
+  def int_aarch64_sve_ftsmul_x   : Guarded_AdvSIMD_SVE_TSMUL_Intrinsic;
+  def int_aarch64_sve_ftssel_x   : Guarded_AdvSIMD_SVE_TSMUL_Intrinsic;
+}
 
 //
-// Floating-point conversions
+// Floating-point reductions
 //
 
-def int_aarch64_sve_fcvt   : AdvSIMD_SVE_FCVT_Intrinsic;
-def int_aarch64_sve_fcvtzs : AdvSIMD_SVE_FCVTZS_Intrinsic;
-def int_aarch64_sve_fcvtzu : AdvSIMD_SVE_FCVTZS_Intrinsic;
-def int_aarch64_sve_scvtf  : AdvSIMD_SVE_SCVTF_Intrinsic;
-def int_aarch64_sve_ucvtf  : AdvSIMD_SVE_SCVTF_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", F16_F32_F64_Overloads>] in
+def int_aarch64_sve_fadda   : Guarded_AdvSIMD_SVE_ReduceWithInit_Intrinsic;
+let TargetGuards = [Variant<"sve", "sme", F16_F32_F64_Overloads>] in {
+  def int_aarch64_sve_faddv   : Guarded_AdvSIMD_SVE_Reduce_Intrinsic;
+  def int_aarch64_sve_fmaxv   : Guarded_AdvSIMD_SVE_Reduce_Intrinsic;
+  def int_aarch64_sve_fmaxnmv : Guarded_AdvSIMD_SVE_Reduce_Intrinsic;
+  def int_aarch64_sve_fminv   : Guarded_AdvSIMD_SVE_Reduce_Intrinsic;
+  def int_aarch64_sve_fminnmv : Guarded_AdvSIMD_SVE_Reduce_Intrinsic;
+}
+
+defvar SveFaddqvTypes = [
+  [llvm_v2f64_ty, llvm_nxv2f64_ty],
+  [llvm_v4f32_ty, llvm_nxv4f32_ty],
+  [llvm_v8f16_ty, llvm_nxv8f16_ty],
+];
+let TargetGuards = [Variant<"sve,(sve2p1|sme2p1)", "sve2p1|sme2p1", SveFaddqvTypes>] in {
+  def int_aarch64_sve_faddqv   : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic;
+  def int_aarch64_sve_fmaxnmqv : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic;
+  def int_aarch64_sve_fminnmqv : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic;
+  def int_aarch64_sve_fmaxqv   : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic;
+  def int_aarch64_sve_fminqv   : Guarded_AdvSIMD_SVE_V128_Reduce_Intrinsic;
+}
 
 //
-// Floating-point comparisons
+// Floating-point conversions
 //
 
-def int_aarch64_sve_facge : AdvSIMD_SVE_Compare_Intrinsic;
-def int_aarch64_sve_facgt : AdvSIMD_SVE_Compare_Intrinsic;
+defvar SveFcvtzsTypes = [
+  [llvm_nxv2i64_ty, llvm_nxv2f64_ty],
+  [llvm_nxv4i32_ty, llvm_nxv4f32_ty],
+  [llvm_nxv8i16_ty, llvm_nxv8f16_ty],
+];
 
-def int_aarch64_sve_fcmpeq : AdvSIMD_SVE_Compare_Intrinsic;
-def int_aarch64_sve_fcmpge : AdvSIMD_SVE_Compare_Intrinsic;
-def int_aarch64_sve_fcmpgt : AdvSIMD_SVE_Compare_Intrinsic;
-def int_aarch64_sve_fcmpne : AdvSIMD_SVE_Compare_Intrinsic;
-def int_aarch64_sve_fcmpuo : AdvSIMD_SVE_Compare_Intrinsic;
+let TargetGuards = [Variant<"sve", "sme", SveFcvtzsTypes>] in {
+  def int_aarch64_sve_fcvtzs : Guarded_AdvSIMD_SVE_FCVTZS_Intrinsic;
+  def int_aarch64_sve_fcvtzu : Guarded_AdvSIMD_SVE_FCVTZS_Intrinsic;
+}
 
-def int_aarch64_sve_fcvtzs_i32f16   : Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
-def int_aarch64_sve_fcvtzs_i32f64   : Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
-def int_aarch64_sve_fcvtzs_i64f16   : Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv8f16_ty>;
-def int_aarch64_sve_fcvtzs_i64f32   : Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
+defvar SveScvtfTypes = [
+  [llvm_nxv2f64_ty, llvm_nxv2i64_ty],
+  [llvm_nxv4f32_ty, llvm_nxv4i32_ty],
+  [llvm_nxv8f16_ty, llvm_nxv8i16_ty],
+];
 
-def int_aarch64_sve_fcvt_bf16f32_v2   : Builtin_SVCVT<llvm_nxv8bf16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
-def int_aarch64_sve_fcvtnt_bf16f32_v2 : Builtin_SVCVT<llvm_nxv8bf16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
-def int_aarch64_sve_fcvtnt_z_bf16f32  : Builtin_SVCVT<llvm_nxv8bf16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
+let TargetGuards = [Variant<"sve", "sme", SveScvtfTypes>] in {
+  def int_aarch64_sve_scvtf  : Guarded_AdvSIMD_SVE_SCVTF_Intrinsic;
+  def int_aarch64_sve_ucvtf  : Guarded_AdvSIMD_SVE_SCVTF_Intrinsic;
+}
 
-def int_aarch64_sve_fcvtzu_i32f16   : Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
-def int_aarch64_sve_fcvtzu_i32f64   : Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
-def int_aarch64_sve_fcvtzu_i64f16   : Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv8f16_ty>;
-def int_aarch64_sve_fcvtzu_i64f32   : Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
+//
+// Floating-point comparisons
+//
 
-def int_aarch64_sve_fcvt_f16f32     : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
-def int_aarch64_sve_fcvt_f16f64     : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
-def int_aarch64_sve_fcvt_f32f64     : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
+let TargetGuards = [Variant<"sve", "sme", F16_F32_F64_Overloads>] in {
+  def int_aarch64_sve_facge : Guarded_AdvSIMD_SVE_Compare_Intrinsic;
+  def int_aarch64_sve_facgt : Guarded_AdvSIMD_SVE_Compare_Intrinsic;
+  def int_aarch64_sve_fcmpeq : Guarded_AdvSIMD_SVE_Compare_Intrinsic;
+  def int_aarch64_sve_fcmpge : Guarded_AdvSIMD_SVE_Compare_Intrinsic;
+  def int_aarch64_sve_fcmpgt : Guarded_AdvSIMD_SVE_Compare_Intrinsic;
+  def int_aarch64_sve_fcmpne : Guarded_AdvSIMD_SVE_Compare_Intrinsic;
+  def int_aarch64_sve_fcmpuo : Guarded_AdvSIMD_SVE_Compare_Intrinsic;
+}
 
-def int_aarch64_sve_fcvt_f32f16     : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
-def int_aarch64_sve_fcvt_f64f16     : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv8f16_ty>;
-def int_aarch64_sve_fcvt_f64f32     : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
+let TargetGuards = [Variant<"sve", "sme", EmptyOverload>] in {
+  def int_aarch64_sve_fcvtzs_i32f16   : Guarded_Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
+  def int_aarch64_sve_fcvtzs_i32f64   : Guarded_Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
+  def int_aarch64_sve_fcvtzs_i64f16   : Guarded_Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv8f16_ty>;
+  def int_aarch64_sve_fcvtzs_i64f32   : Guarded_Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
+  def int_aarch64_sve_fcvtzu_i32f16   : Guarded_Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
+  def int_aarch64_sve_fcvtzu_i32f64   : Guarded_Builtin_SVCVT<llvm_nxv4i32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
+  def int_aarch64_sve_fcvtzu_i64f16   : Guarded_Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv8f16_ty>;
+  def int_aarch64_sve_fcvtzu_i64f32   : Guarded_Builtin_SVCVT<llvm_nxv2i64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
+  def int_aarch64_sve_fcvt_f16f32     : Guarded_Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
+  def int_aarch64_sve_fcvt_f16f64     : Guarded_Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
+  def int_aarch64_sve_fcvt_f32f64     : Guarded_Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
+  def int_aarch64_sve_fcvt_f32f16     : Guarded_Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
+  def int_aarch64_sve_fcvt_f64f16     : Guarded_Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv8f16_ty>;
+  def int_aarch64_sve_fcvt_f64f32     : Guarded_Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
+  def int_aarch64_sve_scvtf_f16i32    : Guarded_Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4i32_ty>;
+  def int_aarch64_sve_scvtf_f16i64    : Guarded_Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
+  def int_aarch64_sve_scvtf_f32i64    : Guarded_Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
+  def int_aarch64_sve_scvtf_f64i32    : Guarded_Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4i32_ty>;
+  def int_aarch64_sve_ucvtf_f16i32    : Guarded_Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4i32_ty>;
+  def int_aarch64_sve_ucvtf_f16i64    : Guarded_Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
+  def int_aarch64_sve_ucvtf_f32i64    : Guarded_Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
+  def int_aarch64_sve_ucvtf_f64i32    : Guarded_Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4i32_ty>;
+}
 
-def int_aarch64_sve_fcvtlt_f32f16   : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
-def int_aarch64_sve_fcvtlt_f64f32   : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
-def int_aarch64_sve_fcvtnt_f16f32   : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
-def int_aarch64_sve_fcvtnt_z_f16f32 : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
-def int_aarch64_sve_fcvtnt_f32f64   : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
-def int_aarch64_sve_fcvtnt_z_f32f64 : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
+let TargetGuards = [Variant<"sve,bf16", "sme,bf16", EmptyOverload>] in {
+  def int_aarch64_sve_fcvt_bf16f32_v2   : Guarded_Builtin_SVCVT<llvm_nxv8bf16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
+  def int_aarch64_sve_fcvtnt_bf16f32_v2 : Guarded_Builtin_SVCVT<llvm_nxv8bf16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
+}
 
-def int_aarch64_sve_fcvtx_f32f64     : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
-def int_aarch64_sve_fcvtxnt_f32f64   : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
-def int_aarch64_sve_fcvtxnt_z_f32f64 : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
+let TargetGuards = [Variant<"sve,(sve2p2|sme2p2)", "sve2p2|sme2p2", EmptyOverload>] in {
+  def int_aarch64_sve_fcvtnt_z_bf16f32  : Guarded_Builtin_SVCVT<llvm_nxv8bf16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
+  def int_aarch64_sve_fcvtnt_z_f16f32 : Guarded_Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
+  def int_aarch64_sve_fcvtnt_z_f32f64 : Guarded_Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
+  def int_aarch64_sve_fcvtxnt_z_f32f64 : Guarded_Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
+}
 
-def int_aarch64_sve_scvtf_f16i32    : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4i32_ty>;
-def int_aarch64_sve_scvtf_f16i64    : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
-def int_aarch64_sve_scvtf_f32i64    : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
-def int_aarch64_sve_scvtf_f64i32    : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4i32_ty>;
+let TargetGuards = [
+  Variant<"sve,(sve2|sme)", "sme", EmptyOverload>,
+] in {
+  def int_aarch64_sve_fcvtlt_f32f16   : Guarded_Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv4i1_ty, llvm_nxv8f16_ty>;
+  def int_aarch64_sve_fcvtlt_f64f32   : Guarded_Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4f32_ty>;
+}
 
-def int_aarch64_sve_ucvtf_f16i32    : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4i32_ty>;
-def int_aarch64_sve_ucvtf_f16i64    : Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
-def int_aarch64_sve_ucvtf_f32i64    : Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2i64_ty>;
-def int_aarch64_sve_ucvtf_f64i32    : Builtin_SVCVT<llvm_nxv2f64_ty, llvm_nxv2i1_ty, llvm_nxv4i32_ty>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", EmptyOverload>] in {
+  def int_aarch64_sve_fcvtnt_f16f32   : Guarded_Builtin_SVCVT<llvm_nxv8f16_ty, llvm_nxv4i1_ty, llvm_nxv4f32_ty>;
+  def int_aarch64_sve_fcvtnt_f32f64   : Guarded_Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
+  def int_aarch64_sve_fcvtx_f32f64     : Guarded_Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
+  def int_aarch64_sve_fcvtxnt_f32f64   : Guarded_Builtin_SVCVT<llvm_nxv4f32_ty, llvm_nxv2i1_ty, llvm_nxv2f64_ty>;
+}
 
-//
-// Predicate creation
-//
+let TargetGuards = [Variant<"sve", "sme", [[llvm_nxv16i1_ty]]>] in {
+  //
+  // Predicate operations
+  //
+  def int_aarch64_sve_and_z   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_bic_z   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_brka    : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_brka_z  : Guarded_AdvSIMD_Pred1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_brkb    : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_brkb_z  : Guarded_AdvSIMD_Pred1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_brkn_z  : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_brkpa_z : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_brkpb_z : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_eor_z   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_nand_z  : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_nor_z   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_orn_z   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_orr_z   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_pfirst  : Guarded_AdvSIMD_Pred1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_punpkhi : Guarded_AdvSIMD_SVE_PUNPKHI_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_punpklo : Guarded_AdvSIMD_SVE_PUNPKHI_Intrinsic<[IntrSpeculatable]>;
 
-def int_aarch64_sve_ptrue : AdvSIMD_SVE_PTRUE_Intrinsic;
+  //
+  // Testing predicates
+  //
+  def int_aarch64_sve_ptest_any   : Guarded_AdvSIMD_SVE_PTEST_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ptest_first : Guarded_AdvSIMD_SVE_PTEST_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ptest_last  : Guarded_AdvSIMD_SVE_PTEST_Intrinsic<[IntrSpeculatable]>;
+}
 
-//
-// Predicate operations
-//
+let TargetGuards = [Variant<"sve", "sme", Predicate_Overloads>] in {
+  //
+  // Predicate creation
+  //
+  def int_aarch64_sve_ptrue : Guarded_AdvSIMD_SVE_PTRUE_Intrinsic;
 
-def int_aarch64_sve_and_z   : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_bic_z   : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_brka    : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_brka_z  : AdvSIMD_Pred1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_brkb    : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_brkb_z  : AdvSIMD_Pred1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_brkn_z  : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_brkpa_z : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_brkpb_z : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_eor_z   : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_nand_z  : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_nor_z   : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_orn_z   : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_orr_z   : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_pfirst  : AdvSIMD_Pred1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_pnext   : AdvSIMD_Pred1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_punpkhi : AdvSIMD_SVE_PUNPKHI_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_punpklo : AdvSIMD_SVE_PUNPKHI_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_pnext   : Guarded_AdvSIMD_Pred1VectorArg_Intrinsic<[IntrSpeculatable]>;
 
-//
-// Testing predicates
-//
+  //
+  // Counting active elements
+  //
+  def int_aarch64_sve_cntp : Guarded_AdvSIMD_SVE_CNTP_Intrinsic<[IntrSpeculatable]>;
 
-def int_aarch64_sve_ptest_any   : AdvSIMD_SVE_PTEST_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ptest_first : AdvSIMD_SVE_PTEST_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ptest_last  : AdvSIMD_SVE_PTEST_Intrinsic<[IntrSpeculatable]>;
+  //
+  // Saturating inc/dec of active elements
+  //
+  def int_aarch64_sve_sqdecp_n32 : Guarded_AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqdecp_n64 : Guarded_AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqincp_n32 : Guarded_AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_sqincp_n64 : Guarded_AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqdecp_n32 : Guarded_AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqdecp_n64 : Guarded_AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqincp_n32 : Guarded_AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i32_ty, [IntrSpeculatable]>;
+  def int_aarch64_sve_uqincp_n64 : Guarded_AdvSIMD_SVE_Saturating_N_Intrinsic<llvm_i64_ty, [IntrSpeculatable]>;
+}
 
 //
 // Reinterpreting data
 //
 
-def int_aarch64_sve_convert_from_svbool : DefaultAttrsIntrinsic<
-    [llvm_anyvector_ty], [llvm_nxv16i1_ty], [IntrNoMem, IntrSpeculatable]>;
+defvar ConvertToFromSvboolTypes = [
+  [llvm_nxv16i1_ty],
+  [llvm_nxv8i1_ty],
+  [llvm_nxv4i1_ty],
+  [llvm_nxv2i1_ty],
+  [llvm_nxv1i1_ty],
+];
+let TargetGuards = [Variant<"sve", "sme", ConvertToFromSvboolTypes>] in
+  def int_aarch64_sve_convert_from_svbool : GuardedDefaultIntrinsic<
+      [llvm_anyvector_ty], [llvm_nxv16i1_ty], [IntrNoMem, IntrSpeculatable]>;
 
-def int_aarch64_sve_convert_to_svbool : DefaultAttrsIntrinsic<
-    [llvm_nxv16i1_ty], [llvm_anyvector_ty], [IntrNoMem, IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve", "sme", ConvertToFromSvboolTypes>] in
+  def int_aarch64_sve_convert_to_svbool : GuardedDefaultIntrinsic<
+      [llvm_nxv16i1_ty], [llvm_anyvector_ty], [IntrNoMem, IntrSpeculatable]>;
 
-def int_aarch64_sve_convert_from_svcount : DefaultAttrsIntrinsic<
-    [llvm_nxv16i1_ty], [llvm_aarch64_svcount_ty], [IntrNoMem, IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2p1|sme2)", "sve2p1|sme2", [[]]>] in
+  def int_aarch64_sve_convert_from_svcount : GuardedDefaultIntrinsic<
+      [llvm_nxv16i1_ty], [llvm_aarch64_svcount_ty], [IntrNoMem, IntrSpeculatable]>;
 
-def int_aarch64_sve_convert_to_svcount : DefaultAttrsIntrinsic<
-    [llvm_aarch64_svcount_ty], [llvm_nxv16i1_ty], [IntrNoMem, IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2p1|sme2)", "sve2p1|sme2", [[]]>] in
+  def int_aarch64_sve_convert_to_svcount : GuardedDefaultIntrinsic<
+      [llvm_aarch64_svcount_ty], [llvm_nxv16i1_ty], [IntrNoMem, IntrSpeculatable]>;
 
 //
 // Gather loads: scalar base + vector offsets
 //
 
 // 64 bit unscaled offsets
-def int_aarch64_sve_ld1_gather : AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in
+def int_aarch64_sve_ld1_gather : Guarded_AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
 
 // 64 bit scaled offsets
-def int_aarch64_sve_ld1_gather_index : AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in
+def int_aarch64_sve_ld1_gather_index : Guarded_AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
 
 // 32 bit unscaled offsets, sign (sxtw) or zero (zxtw) extended to 64 bits
-def int_aarch64_sve_ld1_gather_sxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
-def int_aarch64_sve_ld1_gather_uxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_ld1_gather_sxtw : Guarded_AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
+  def int_aarch64_sve_ld1_gather_uxtw : Guarded_AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
+}
 
 // 32 bit scaled offsets, sign (sxtw) or zero (zxtw) extended to 64 bits
-def int_aarch64_sve_ld1_gather_sxtw_index : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
-def int_aarch64_sve_ld1_gather_uxtw_index : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_ld1_gather_sxtw_index : Guarded_AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
+  def int_aarch64_sve_ld1_gather_uxtw_index : Guarded_AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
+}
 
 // 128-bit loads, scaled offsets (indices)
-def int_aarch64_sve_ld1q_gather_index : AdvSIMD_GatherLoadQ_SV_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2p1", PackedDataPTR_OverloadPairs>] in
+def int_aarch64_sve_ld1q_gather_index : Guarded_AdvSIMD_GatherLoadQ_SV_Intrinsic;
 
 // 128-bit loads, unscaled offsets
-def int_aarch64_sve_ld1q_gather_vector_offset : AdvSIMD_GatherLoadQ_SV_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2p1", DataPTR_OverloadPairs>] in
+def int_aarch64_sve_ld1q_gather_vector_offset : Guarded_AdvSIMD_GatherLoadQ_SV_Intrinsic;
 
 //
 // Gather loads: vector base + scalar offset
 //
 
-def int_aarch64_sve_ld1_gather_scalar_offset : AdvSIMD_GatherLoad_VS_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataI32_DataI64_OverloadPairs>] in
+def int_aarch64_sve_ld1_gather_scalar_offset : Guarded_AdvSIMD_GatherLoad_VS_Intrinsic;
 
 // 128-bit loads, unscaled offsets
-def int_aarch64_sve_ld1q_gather_scalar_offset : AdvSIMD_GatherLoadQ_VS_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2p1", PackedDataI64_OverloadPairs>] in
+def int_aarch64_sve_ld1q_gather_scalar_offset : Guarded_AdvSIMD_GatherLoadQ_VS_Intrinsic;
 
 //
 // First-faulting gather loads: scalar base + vector offsets
 //
 
 // 64 bit unscaled offsets
-def int_aarch64_sve_ldff1_gather : AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in
+def int_aarch64_sve_ldff1_gather : Guarded_AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic;
 
 // 64 bit scaled offsets
-def int_aarch64_sve_ldff1_gather_index : AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in
+def int_aarch64_sve_ldff1_gather_index : Guarded_AdvSIMD_GatherLoad_SV_64b_Offsets_WriteFFR_Intrinsic;
 
 // 32 bit unscaled offsets, sign (sxtw) or zero (uxtw) extended to 64 bits
-def int_aarch64_sve_ldff1_gather_sxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
-def int_aarch64_sve_ldff1_gather_uxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_ldff1_gather_sxtw : Guarded_AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
+  def int_aarch64_sve_ldff1_gather_uxtw : Guarded_AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
+}
 
 // 32 bit scaled offsets, sign (sxtw) or zero (uxtw) extended to 64 bits
-def int_aarch64_sve_ldff1_gather_sxtw_index : AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
-def int_aarch64_sve_ldff1_gather_uxtw_index : AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_ldff1_gather_sxtw_index : Guarded_AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
+  def int_aarch64_sve_ldff1_gather_uxtw_index : Guarded_AdvSIMD_GatherLoad_SV_32b_Offsets_WriteFFR_Intrinsic;
+}
 
 //
 // First-faulting gather loads: vector base + scalar offset
 //
 
-def int_aarch64_sve_ldff1_gather_scalar_offset : AdvSIMD_GatherLoad_VS_WriteFFR_Intrinsic;
-
+let TargetGuards = [NonStreamingVariant<"sve", DataI32_DataI64_OverloadPairs>] in
+def int_aarch64_sve_ldff1_gather_scalar_offset : Guarded_AdvSIMD_GatherLoad_VS_WriteFFR_Intrinsic;
 
 //
 // Non-temporal gather loads: scalar base + vector offsets
 //
 
 // 64 bit unscaled offsets
-def int_aarch64_sve_ldnt1_gather : AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2", DataPTR_OverloadPairs>] in
+def int_aarch64_sve_ldnt1_gather : Guarded_AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
 
 // 64 bit indices
-def int_aarch64_sve_ldnt1_gather_index : AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2", DataPTR_OverloadPairs>] in
+def int_aarch64_sve_ldnt1_gather_index : Guarded_AdvSIMD_GatherLoad_SV_64b_Offsets_Intrinsic;
 
 // 32 bit unscaled offsets, zero (zxtw) extended to 64 bits
-def int_aarch64_sve_ldnt1_gather_uxtw : AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2", DataPTR_OverloadPairs>] in
+def int_aarch64_sve_ldnt1_gather_uxtw : Guarded_AdvSIMD_GatherLoad_SV_32b_Offsets_Intrinsic;
 
 //
 // Non-temporal gather loads: vector base + scalar offset
 //
 
-def int_aarch64_sve_ldnt1_gather_scalar_offset  : AdvSIMD_GatherLoad_VS_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2", DataI32_DataI64_OverloadPairs>] in
+def int_aarch64_sve_ldnt1_gather_scalar_offset  : Guarded_AdvSIMD_GatherLoad_VS_Intrinsic;
 
 //
 // Scatter stores: scalar base + vector offsets
 //
 
 // 64 bit unscaled offsets
-def int_aarch64_sve_st1_scatter : AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in
+def int_aarch64_sve_st1_scatter : Guarded_AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
 
 // 64 bit scaled offsets
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in
 def int_aarch64_sve_st1_scatter_index
-    : AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
+    : Guarded_AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
 
 // 32 bit unscaled offsets, sign (sxtw) or zero (zxtw) extended to 64 bits
-def int_aarch64_sve_st1_scatter_sxtw
-    : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
-
-def int_aarch64_sve_st1_scatter_uxtw
-    : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_st1_scatter_sxtw
+    : Guarded_AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
+  def int_aarch64_sve_st1_scatter_uxtw
+    : Guarded_AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
+}
 
 // 32 bit scaled offsets, sign (sxtw) or zero (zxtw) extended to 64 bits
-def int_aarch64_sve_st1_scatter_sxtw_index
-    : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
-
-def int_aarch64_sve_st1_scatter_uxtw_index
-    : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_st1_scatter_sxtw_index
+    : Guarded_AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
+  def int_aarch64_sve_st1_scatter_uxtw_index
+    : Guarded_AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
+}
 
 // 128-bit stores, scaled offsets (indices)
-def int_aarch64_sve_st1q_scatter_index : AdvSIMD_ScatterStoreQ_SV_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2p1", PackedDataPTR_OverloadPairs>] in
+def int_aarch64_sve_st1q_scatter_index : Guarded_AdvSIMD_ScatterStoreQ_SV_Intrinsic;
 
 // 128-bit stores, unscaled offsets
-def int_aarch64_sve_st1q_scatter_vector_offset : AdvSIMD_ScatterStoreQ_SV_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2p1", PackedDataPTR_OverloadPairs>] in
+def int_aarch64_sve_st1q_scatter_vector_offset : Guarded_AdvSIMD_ScatterStoreQ_SV_Intrinsic;
 
 //
 // Scatter stores: vector base + scalar offset
 //
 
-def int_aarch64_sve_st1_scatter_scalar_offset : AdvSIMD_ScatterStore_VS_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve", DataI32_DataI64_OverloadPairs>] in
+def int_aarch64_sve_st1_scatter_scalar_offset : Guarded_AdvSIMD_ScatterStore_VS_Intrinsic;
 
 // 128-bit stores, unscaled offsets
-def int_aarch64_sve_st1q_scatter_scalar_offset : AdvSIMD_ScatterStoreQ_VS_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2p1", PackedDataI64_OverloadPairs>] in
+def int_aarch64_sve_st1q_scatter_scalar_offset : Guarded_AdvSIMD_ScatterStoreQ_VS_Intrinsic;
 
 //
 // Non-temporal scatter stores: scalar base + vector offsets
 //
 
 // 64 bit unscaled offsets
-def int_aarch64_sve_stnt1_scatter : AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2", DataPTR_OverloadPairs>] in
+def int_aarch64_sve_stnt1_scatter : Guarded_AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
 
 // 64 bit indices
+let TargetGuards = [NonStreamingVariant<"sve2", DataPTR_OverloadPairs>] in
 def int_aarch64_sve_stnt1_scatter_index
-    : AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
+    : Guarded_AdvSIMD_ScatterStore_SV_64b_Offsets_Intrinsic;
 
 // 32 bit unscaled offsets, zero (zxtw) extended to 64 bits
-def int_aarch64_sve_stnt1_scatter_uxtw : AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2", DataPTR_OverloadPairs>] in
+def int_aarch64_sve_stnt1_scatter_uxtw : Guarded_AdvSIMD_ScatterStore_SV_32b_Offsets_Intrinsic;
 
 //
 // Non-temporal scatter stores: vector base + scalar offset
 //
 
-def int_aarch64_sve_stnt1_scatter_scalar_offset  : AdvSIMD_ScatterStore_VS_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2", DataI32_DataI64_OverloadPairs>] in
+def int_aarch64_sve_stnt1_scatter_scalar_offset  : Guarded_AdvSIMD_ScatterStore_VS_Intrinsic;
 
 //
 // SVE2 - Uniform DSP operations
 //
 
-def int_aarch64_sve_saba          : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sabal         : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uabal         : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_shadd         : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_shsub         : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_shsub_u       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_shsubr        : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sli           : AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqabs         : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqadd         : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmulh       : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmulh_lane  : AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqneg         : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqrdmlah      : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqrdmlah_lane : AdvSIMD_3VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqrdmlsh      : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqrdmlsh_lane : AdvSIMD_3VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqrdmulh      : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqrdmulh_lane : AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqrshl        : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqrshl_u      : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqshl         : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqshl_u       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqshlu        : AdvSIMD_SVE_ShiftByImm_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqsub         : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqsub_u       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqsubr        : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_srhadd        : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sri           : AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_srshl         : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_srshl_u       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_srshr         : AdvSIMD_SVE_ShiftByImm_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_srsra         : AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ssra          : AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_suqadd        : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uaba          : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uhadd         : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uhsub         : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uhsub_u       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uhsubr        : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqadd         : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqrshl        : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqrshl_u      : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqshl         : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqshl_u       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqsub         : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqsub_u       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqsubr        : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_urecpe        : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_urhadd        : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_urshl         : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_urshl_u       : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_urshr         : AdvSIMD_SVE_ShiftByImm_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ursqrte       : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ursra         : AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_usqadd        : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_usra          : AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_saba          : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_shadd         : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_shsub         : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_shsub_u       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_shsubr        : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sli           : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqabs         : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqadd         : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmulh       : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqneg         : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrdmlah      : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrdmlsh      : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrdmulh      : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrshl        : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrshl_u      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqshl         : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqshl_u       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqshlu        : Guarded_AdvSIMD_SVE_ShiftByImm_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqsub         : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqsub_u       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqsubr        : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_srhadd        : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sri           : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_srshl         : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_srshl_u       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_srshr         : Guarded_AdvSIMD_SVE_ShiftByImm_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_srsra         : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ssra          : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_suqadd        : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uaba          : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uhadd         : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uhsub         : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uhsub_u       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uhsubr        : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqadd         : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqrshl        : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqrshl_u      : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqshl         : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqshl_u       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqsub         : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqsub_u       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqsubr        : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_urhadd        : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_urshl         : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_urshl_u       : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_urshr         : Guarded_AdvSIMD_SVE_ShiftByImm_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ursra         : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_usqadd        : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_usra          : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve,(sve2p3|sme2p3)", "sve2p3|sme2p3", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_sabal         : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uabal         : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_sqdmulh_lane  : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrdmlah_lane : Guarded_AdvSIMD_3VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrdmlsh_lane : Guarded_AdvSIMD_3VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrdmulh_lane : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I32_Overloads>] in {
+  def int_aarch64_sve_urecpe        : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ursqrte       : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 - Widening DSP operations
 //
 
-def int_aarch64_sve_sabalb : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sabalt : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sabdlb : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sabdlt : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_saddlb : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_saddlt : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_saddwb : SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_saddwt : SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sshllb : SVE2_1VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sshllt : SVE2_1VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ssublb : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ssublt : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ssubwb : SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ssubwt : SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uabalb : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uabalt : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uabdlb : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uabdlt : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uaddlb : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uaddlt : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uaddwb : SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uaddwt : SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ushllb : SVE2_1VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ushllt : SVE2_1VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_usublb : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_usublt : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_usubwb : SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_usubwt : SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_sabalb : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sabalt : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sabdlb : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sabdlt : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_saddlb : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_saddlt : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_saddwb : Guarded_SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_saddwt : Guarded_SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sshllb : Guarded_SVE2_1VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sshllt : Guarded_SVE2_1VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ssublb : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ssublt : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ssubwb : Guarded_SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ssubwt : Guarded_SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uabalb : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uabalt : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uabdlb : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uabdlt : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uaddlb : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uaddlt : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uaddwb : Guarded_SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uaddwt : Guarded_SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ushllb : Guarded_SVE2_1VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ushllt : Guarded_SVE2_1VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_usublb : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_usublt : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_usubwb : Guarded_SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_usubwt : Guarded_SVE2_2VectorArg_Wide_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 - Non-widening pairwise arithmetic
 //
 
-def int_aarch64_sve_addp    : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_faddp   : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fmaxp   : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fmaxnmp : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fminp   : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_fminnmp : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_smaxp   : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sminp   : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umaxp   : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uminp   : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_addp    : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smaxp   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sminp   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umaxp   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uminp   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
 
-def int_aarch64_sve_addqp   : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_addsubp : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_subp    : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", F16_F32_F64_Overloads>] in {
+  def int_aarch64_sve_faddp   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fmaxp   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fmaxnmp : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fminp   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_fminnmp : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+}
+
+let TargetGuards = [Variant<"sve,(sve2p3|sme2p3)", "sve2p3|sme2p3", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_addqp   : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_addsubp : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_subp    : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 - Widening pairwise arithmetic
 //
 
-def int_aarch64_sve_sadalp : SVE2_2VectorArg_Pred_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uadalp : SVE2_2VectorArg_Pred_Long_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_sadalp : Guarded_SVE2_2VectorArg_Pred_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uadalp : Guarded_SVE2_2VectorArg_Pred_Long_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 - Uniform complex integer arithmetic
 //
 
-def int_aarch64_sve_cadd_x           : AdvSIMD_SVE2_CADD_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqcadd_x         : AdvSIMD_SVE2_CADD_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmla_x           : AdvSIMD_SVE2_CMLA_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cmla_lane_x      : AdvSIMD_SVE_CMLA_LANE_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqrdcmlah_x      : AdvSIMD_SVE2_CMLA_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqrdcmlah_lane_x : AdvSIMD_SVE_CMLA_LANE_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_cadd_x           : Guarded_AdvSIMD_SVE2_CADD_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqcadd_x         : Guarded_AdvSIMD_SVE2_CADD_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cmla_x           : Guarded_AdvSIMD_SVE2_CMLA_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrdcmlah_x      : Guarded_AdvSIMD_SVE2_CMLA_Intrinsic<[IntrSpeculatable]>;
+}
+
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_Overloads>] in {
+  def int_aarch64_sve_cmla_lane_x      : Guarded_AdvSIMD_SVE_CMLA_LANE_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrdcmlah_lane_x : Guarded_AdvSIMD_SVE_CMLA_LANE_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 - Widening complex integer arithmetic
 //
 
-def int_aarch64_sve_saddlbt   : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ssublbt   : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_ssubltb   : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_saddlbt   : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ssublbt   : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_ssubltb   : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 - Widening complex integer dot product
 //
 
-def int_aarch64_sve_cdot      : AdvSIMD_SVE_DOT_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_cdot_lane : AdvSIMD_SVE_CDOT_LANE_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I32_I64_Overloads>] in {
+  def int_aarch64_sve_cdot      : Guarded_AdvSIMD_SVE_DOT_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_cdot_lane : Guarded_AdvSIMD_SVE_CDOT_LANE_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 - Floating-point widening multiply-accumulate
 //
 
-def int_aarch64_sve_fmlalb        : SVE2_3VectorArg_Long_Intrinsic;
-def int_aarch64_sve_fmlalb_lane   : SVE2_3VectorArgIndexed_Long_Intrinsic;
-def int_aarch64_sve_fmlalt        : SVE2_3VectorArg_Long_Intrinsic;
-def int_aarch64_sve_fmlalt_lane   : SVE2_3VectorArgIndexed_Long_Intrinsic;
-def int_aarch64_sve_fmlslb        : SVE2_3VectorArg_Long_Intrinsic;
-def int_aarch64_sve_fmlslb_lane   : SVE2_3VectorArgIndexed_Long_Intrinsic;
-def int_aarch64_sve_fmlslt        : SVE2_3VectorArg_Long_Intrinsic;
-def int_aarch64_sve_fmlslt_lane   : SVE2_3VectorArgIndexed_Long_Intrinsic;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", F32_Overloads>] in {
+  def int_aarch64_sve_fmlalb        : Guarded_SVE2_3VectorArg_Long_Intrinsic;
+  def int_aarch64_sve_fmlalb_lane   : Guarded_SVE2_3VectorArgIndexed_Long_Intrinsic;
+  def int_aarch64_sve_fmlalt        : Guarded_SVE2_3VectorArg_Long_Intrinsic;
+  def int_aarch64_sve_fmlalt_lane   : Guarded_SVE2_3VectorArgIndexed_Long_Intrinsic;
+  def int_aarch64_sve_fmlslb        : Guarded_SVE2_3VectorArg_Long_Intrinsic;
+  def int_aarch64_sve_fmlslb_lane   : Guarded_SVE2_3VectorArgIndexed_Long_Intrinsic;
+  def int_aarch64_sve_fmlslt        : Guarded_SVE2_3VectorArg_Long_Intrinsic;
+  def int_aarch64_sve_fmlslt_lane   : Guarded_SVE2_3VectorArgIndexed_Long_Intrinsic;
+}
 
 //
 // SVE2 - Multi-vector narrowing convert to floating point
 //
 
-def int_aarch64_sve_scvtfb
-    : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty], [IntrNoMem]>;
-def int_aarch64_sve_scvtft
-    : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty], [IntrNoMem]>;
-def int_aarch64_sve_ucvtfb
-    : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty], [IntrNoMem]>;
-def int_aarch64_sve_ucvtft
-    : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty], [IntrNoMem]>;
+defvar SveScvtfbTypes = [
+  [llvm_nxv2f64_ty, llvm_nxv4i32_ty],
+  [llvm_nxv4f32_ty, llvm_nxv8i16_ty],
+  [llvm_nxv8f16_ty, llvm_nxv16i8_ty],
+];
+
+let TargetGuards = [Variant<"sve,(sve2p3|sme2p3)", "sve2p3|sme2p3", SveScvtfbTypes>] in {
+  def int_aarch64_sve_scvtfb
+    : GuardedDefaultIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty], [IntrNoMem]>;
+  def int_aarch64_sve_scvtft
+    : GuardedDefaultIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty], [IntrNoMem]>;
+  def int_aarch64_sve_ucvtfb
+    : GuardedDefaultIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty], [IntrNoMem]>;
+  def int_aarch64_sve_ucvtft
+    : GuardedDefaultIntrinsic<[llvm_anyfloat_ty], [llvm_anyint_ty], [IntrNoMem]>;
+}
 
 //
 // SVE2 - Floating-point integer binary logarithm
 //
 
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", F16_F32_F64_Overloads>] in
 def int_aarch64_sve_flogb : AdvSIMD_SVE_LOGB_Intrinsic;
 
 //
 // SVE2 - Vector histogram count
 //
 
-def int_aarch64_sve_histcnt : AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_histseg : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [NonStreamingVariant<"sve2", I32_I64_Overloads>] in
+def int_aarch64_sve_histcnt : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [NonStreamingVariant<"sve2", I8_Overloads>] in
+def int_aarch64_sve_histseg : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
 
 //
 // SVE2 - Character match
 //
 
-def int_aarch64_sve_match   : AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_nmatch  : AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [NonStreamingVariant<"sve2", I8_I16_Overloads>] in {
+  def int_aarch64_sve_match   : Guarded_AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_nmatch  : Guarded_AdvSIMD_SVE_Compare_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 - Unary narrowing operations
 //
 
-def int_aarch64_sve_sqxtnb  : SVE2_1VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqxtnt  : SVE2_Merged1VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqxtunb : SVE2_1VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqxtunt : SVE2_Merged1VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqxtnb  : SVE2_1VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqxtnt  : SVE2_Merged1VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_sqxtnb  : Guarded_SVE2_1VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqxtnt  : Guarded_SVE2_Merged1VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqxtunb : Guarded_SVE2_1VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqxtunt : Guarded_SVE2_Merged1VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqxtnb  : Guarded_SVE2_1VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqxtnt  : Guarded_SVE2_Merged1VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 - Binary narrowing DSP operations
 //
-def int_aarch64_sve_addhnb    : SVE2_2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_addhnt    : SVE2_Merged2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_raddhnb   : SVE2_2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_raddhnt   : SVE2_Merged2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_subhnb    : SVE2_2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_subhnt    : SVE2_Merged2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_rsubhnb   : SVE2_2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_rsubhnt   : SVE2_Merged2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_addhnb    : Guarded_SVE2_2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_addhnt    : Guarded_SVE2_Merged2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_raddhnb   : Guarded_SVE2_2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_raddhnt   : Guarded_SVE2_Merged2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_subhnb    : Guarded_SVE2_2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_subhnt    : Guarded_SVE2_Merged2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_rsubhnb   : Guarded_SVE2_2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_rsubhnt   : Guarded_SVE2_Merged2VectorArg_Narrowing_Intrinsic<[IntrSpeculatable]>;
+}
 
 // Narrowing shift right
-def int_aarch64_sve_shrnb     : SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_shrnt     : SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_rshrnb    : SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_rshrnt    : SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_shrnb     : Guarded_SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_shrnt     : Guarded_SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_rshrnb    : Guarded_SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_rshrnt    : Guarded_SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+}
 
 // Saturating shift right - signed input/output
-def int_aarch64_sve_sqshrnb   : SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqshrnt   : SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_sqrshrnb  : SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqrshrnt  : SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_sqshrnb   : Guarded_SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqshrnt   : Guarded_SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrshrnb  : Guarded_SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrshrnt  : Guarded_SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+}
 
 // Saturating shift right - unsigned input/output
-def int_aarch64_sve_uqshrnb   : SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqshrnt   : SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_uqrshrnb  : SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uqrshrnt  : SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_uqshrnb   : Guarded_SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqshrnt   : Guarded_SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqrshrnb  : Guarded_SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uqrshrnt  : Guarded_SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+}
 
 // Saturating shift right - signed input, unsigned output
-def int_aarch64_sve_sqshrunb  : SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqshrunt  : SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_sqrshrunb : SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqrshrunt : SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_sqshrunb  : Guarded_SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqshrunt  : Guarded_SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrshrunb : Guarded_SVE2_1VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqrshrunt : Guarded_SVE2_2VectorArg_Imm_Narrowing_Intrinsic<[IntrSpeculatable]>;
+}
 
 // SVE2 MLA LANE.
-def int_aarch64_sve_smlalb_lane   : SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smlalt_lane   : SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umlalb_lane   : SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umlalt_lane   : SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smlslb_lane   : SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smlslt_lane   : SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umlslb_lane   : SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umlslt_lane   : SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smullb_lane   : SVE2_2VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smullt_lane   : SVE2_2VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umullb_lane   : SVE2_2VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umullt_lane   : SVE2_2VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmlalb_lane : SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmlalt_lane : SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmlslb_lane : SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmlslt_lane : SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmullb_lane : SVE2_2VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmullt_lane : SVE2_2VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I32_I64_Overloads>] in {
+  def int_aarch64_sve_smlalb_lane   : Guarded_SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smlalt_lane   : Guarded_SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umlalb_lane   : Guarded_SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umlalt_lane   : Guarded_SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smlslb_lane   : Guarded_SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smlslt_lane   : Guarded_SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umlslb_lane   : Guarded_SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umlslt_lane   : Guarded_SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smullb_lane   : Guarded_SVE2_2VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smullt_lane   : Guarded_SVE2_2VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umullb_lane   : Guarded_SVE2_2VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umullt_lane   : Guarded_SVE2_2VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmlalb_lane : Guarded_SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmlalt_lane : Guarded_SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmlslb_lane : Guarded_SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmlslt_lane : Guarded_SVE2_3VectorArg_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmullb_lane : Guarded_SVE2_2VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmullt_lane : Guarded_SVE2_2VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
+}
 
 // SVE2 MLA Unpredicated.
-def int_aarch64_sve_smlalb      : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smlalt      : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umlalb      : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umlalt      : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smlslb      : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smlslt      : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umlslb      : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umlslt      : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smullb      : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smullt      : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umullb      : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_umullt      : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_sqdmlalb    : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmlalt    : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmlslb    : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmlslt    : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmullb    : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmullt    : SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmlalbt   : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sqdmlslbt   : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_smlalb      : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smlalt      : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umlalb      : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umlalt      : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smlslb      : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smlslt      : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umlslb      : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umlslt      : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smullb      : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smullt      : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umullb      : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_umullt      : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmlalb    : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmlalt    : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmlslb    : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmlslt    : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmullb    : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmullt    : Guarded_SVE2_2VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmlalbt   : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sqdmlslbt   : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+}
 
 // SVE2 ADDSUB Long Unpredicated.
-def int_aarch64_sve_adclb       : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_adclt       : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sbclb       : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sbclt       : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I32_I64_Overloads>] in {
+  def int_aarch64_sve_adclb       : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_adclt       : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sbclb       : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sbclt       : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 - Polynomial arithmetic
 //
-def int_aarch64_sve_eorbt       : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_eortb       : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_pmullb_pair : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_pmullt_pair : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_eorbt       : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_eortb       : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
+let TargetGuards = [
+  Variant<"sve,(sve2|sme)", "sme", I8_Overloads>,
+  Variant<"sve,sve-aes", "ssve-aes", I64_Overloads>,
+  Variant<"sve,(sve2|sme)", "sme", I32_Overloads>,
+] in {
+  def int_aarch64_sve_pmullb_pair : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_pmullt_pair : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 bitwise ternary operations.
 //
-def int_aarch64_sve_eor3   : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_bcax   : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_bsl    : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_bsl1n  : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_bsl2n  : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_nbsl   : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_xar    : AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_eor3   : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_bcax   : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_bsl    : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_bsl1n  : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_bsl2n  : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_nbsl   : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_xar    : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 - Optional AES, SHA-3 and SM4
 //
 
-def int_aarch64_sve_aesd    : ClangBuiltin<"__builtin_sve_svaesd_u8">,
-                              DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
+let TargetGuards = [Variant<"sve,sve-aes", "ssve-aes", EmptyOverload>] in {
+  def int_aarch64_sve_aesd    : ClangBuiltin<"__builtin_sve_svaesd_u8">,
+                              GuardedDefaultIntrinsic<[llvm_nxv16i8_ty],
                                         [llvm_nxv16i8_ty, llvm_nxv16i8_ty],
                                         [IntrNoMem, IntrSpeculatable]>;
-def int_aarch64_sve_aesimc  : ClangBuiltin<"__builtin_sve_svaesimc_u8">,
-                              DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
+  def int_aarch64_sve_aesimc  : ClangBuiltin<"__builtin_sve_svaesimc_u8">,
+                              GuardedDefaultIntrinsic<[llvm_nxv16i8_ty],
                                         [llvm_nxv16i8_ty],
                                         [IntrNoMem, IntrSpeculatable]>;
-def int_aarch64_sve_aese    : ClangBuiltin<"__builtin_sve_svaese_u8">,
-                              DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
+  def int_aarch64_sve_aese    : ClangBuiltin<"__builtin_sve_svaese_u8">,
+                              GuardedDefaultIntrinsic<[llvm_nxv16i8_ty],
                                         [llvm_nxv16i8_ty, llvm_nxv16i8_ty],
                                         [IntrNoMem, IntrSpeculatable]>;
-def int_aarch64_sve_aesmc   : ClangBuiltin<"__builtin_sve_svaesmc_u8">,
-                              DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
+  def int_aarch64_sve_aesmc   : ClangBuiltin<"__builtin_sve_svaesmc_u8">,
+                              GuardedDefaultIntrinsic<[llvm_nxv16i8_ty],
                                         [llvm_nxv16i8_ty],
                                         [IntrNoMem, IntrSpeculatable]>;
+}
+let TargetGuards = [Variant<"sve,sve-sha3", "sme2p1,sve-sha3", EmptyOverload>] in
 def int_aarch64_sve_rax1    : ClangBuiltin<"__builtin_sve_svrax1_u64">,
-                              DefaultAttrsIntrinsic<[llvm_nxv2i64_ty],
+                              GuardedDefaultIntrinsic<[llvm_nxv2i64_ty],
                                         [llvm_nxv2i64_ty, llvm_nxv2i64_ty],
                                         [IntrNoMem, IntrSpeculatable]>;
-def int_aarch64_sve_sm4e    : ClangBuiltin<"__builtin_sve_svsm4e_u32">,
-                              DefaultAttrsIntrinsic<[llvm_nxv4i32_ty],
+let TargetGuards = [NonStreamingVariant<"sve,sve-sm4", EmptyOverload>] in {
+  def int_aarch64_sve_sm4e    : ClangBuiltin<"__builtin_sve_svsm4e_u32">,
+                              GuardedDefaultIntrinsic<[llvm_nxv4i32_ty],
                                         [llvm_nxv4i32_ty, llvm_nxv4i32_ty],
                                         [IntrNoMem, IntrSpeculatable]>;
-def int_aarch64_sve_sm4ekey : ClangBuiltin<"__builtin_sve_svsm4ekey_u32">,
-                              DefaultAttrsIntrinsic<[llvm_nxv4i32_ty],
+  def int_aarch64_sve_sm4ekey : ClangBuiltin<"__builtin_sve_svsm4ekey_u32">,
+                              GuardedDefaultIntrinsic<[llvm_nxv4i32_ty],
                                         [llvm_nxv4i32_ty, llvm_nxv4i32_ty],
                                         [IntrNoMem, IntrSpeculatable]>;
+}
 //
 // SVE2 - Extended table lookup/permute
 //
 
-def int_aarch64_sve_tbl2 : AdvSIMD_SVE2_TBX_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_tbx  : AdvSIMD_SVE2_TBX_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", AllPackedData_Overloads>] in {
+  def int_aarch64_sve_tbl2 : Guarded_AdvSIMD_SVE2_TBX_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_tbx  : Guarded_AdvSIMD_SVE2_TBX_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE2 - Lookup Table
 //
 
-def int_aarch64_sve_luti2_lane : SVE2_LUTI_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_luti4_lane : SVE2_LUTI_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_luti6 : SVE2_LUTI6_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_luti4_lane_x2 : SVE2_LUTI_X2_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_luti6_lane_x2 : SVE2_LUTI_X2_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme2),lut", "sme2,lut", I8_I16_BF16_F16_Overloads>] in {
+  def int_aarch64_sve_luti2_lane : Guarded_SVE2_LUTI_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_luti4_lane : Guarded_SVE2_LUTI_Intrinsic<[IntrSpeculatable]>;
+}
+let TargetGuards = [NonStreamingVariant<"sve2p3", EmptyOverload>] in
+  def int_aarch64_sve_luti6 : Guarded_SVE2_LUTI6_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme2),lut", "sme2,lut", BF16_F16_I16_Overloads>] in
+  def int_aarch64_sve_luti4_lane_x2 : Guarded_SVE2_LUTI_X2_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve2p3", "sve2p3|sme2p3", BF16_F16_I16_Overloads>] in
+  def int_aarch64_sve_luti6_lane_x2 : Guarded_SVE2_LUTI_X2_Intrinsic<[IntrSpeculatable]>;
 
 //
 // SVE2 - Optional bit permutation
 //
 
-def int_aarch64_sve_bdep_x : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_bext_x : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_bgrp_x : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-
+let TargetGuards = [Variant<"sve,sve-bitperm", "ssve-bitperm", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_bdep_x : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_bext_x : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_bgrp_x : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE ACLE: 7.3. INT8 matrix multiply extensions
 //
-def int_aarch64_sve_ummla : SVE_MatMul_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_smmla : SVE_MatMul_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_usmmla : SVE_MatMul_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [NonStreamingVariant<"sve,i8mm", I32_Overloads>] in {
+  def int_aarch64_sve_ummla : Guarded_SVE_MatMul_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_smmla : Guarded_SVE_MatMul_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_usmmla : Guarded_SVE_MatMul_Intrinsic<[IntrSpeculatable]>;
+}
 
-def int_aarch64_sve_usdot : AdvSIMD_SVE_DOT_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_usdot_lane : AdvSIMD_SVE_DOT_Indexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_sudot_lane : AdvSIMD_SVE_DOT_Indexed_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,i8mm", "sme,i8mm", I32_Overloads>] in {
+  def int_aarch64_sve_usdot : Guarded_AdvSIMD_SVE_DOT_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_usdot_lane : Guarded_AdvSIMD_SVE_DOT_Indexed_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_sudot_lane : Guarded_AdvSIMD_SVE_DOT_Indexed_Intrinsic<[IntrSpeculatable]>;
+}
 
 //
 // SVE ACLE: 7.4/5. FP64/FP32 matrix multiply extensions
 //
 
+let TargetGuards = [
+  NonStreamingVariant<"f64mm", F64F64_OverloadPair>,
+  NonStreamingVariant<"f32mm", F32F32_OverloadPair>,
+  NonStreamingVariant<"sve,bf16", F32BF16_OverloadPair>,
+  NonStreamingVariant<"sve-f16f32mm", F32F16_OverloadPair>,
+  NonStreamingVariant<"sve-b16mm", BF16BF16_OverloadPair>,
+  NonStreamingVariant<"sve2p2,f16mm", F16F16_OverloadPair>,
+] in
 def int_aarch64_sve_fmmla
-  : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                           [LLVMMatchType<0>, llvm_anyvector_ty, LLVMMatchType<1>],
                           [IntrNoMem]>;
 
+let TargetGuards = [
+  NonStreamingVariant<"sve2,f8f32mm", F32_Overloads>,
+  NonStreamingVariant<"sve2,f8f16mm", F16_Overloads>,
+] in
 def int_aarch64_sve_fp8_fmmla
-  : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                           [LLVMMatchType<0>, llvm_nxv16i8_ty, llvm_nxv16i8_ty],
                           [IntrRead<[FPMR]>, IntrReadOnly]>;
 
@@ -2886,219 +3356,245 @@ def int_aarch64_sve_fp8_fmmla
 // SVE ACLE: 7.2. BFloat16 extensions
 //
 
-def int_aarch64_sve_bfdot   : SVE_4Vec_BF16;
-def int_aarch64_sve_bfmlalb : SVE_4Vec_BF16;
-def int_aarch64_sve_bfmlalt : SVE_4Vec_BF16;
-
-def int_aarch64_sve_bfdot_lane_v2   : SVE_4Vec_BF16_Indexed;
-def int_aarch64_sve_bfmlalb_lane_v2 : SVE_4Vec_BF16_Indexed;
-def int_aarch64_sve_bfmlalt_lane_v2 : SVE_4Vec_BF16_Indexed;
+let TargetGuards = [Variant<"sve,bf16", "sme,bf16", EmptyOverload>] in {
+  def int_aarch64_sve_bfdot   : Guarded_SVE_4Vec_BF16;
+  def int_aarch64_sve_bfmlalb : Guarded_SVE_4Vec_BF16;
+  def int_aarch64_sve_bfmlalt : Guarded_SVE_4Vec_BF16;
+  def int_aarch64_sve_bfdot_lane_v2   : Guarded_SVE_4Vec_BF16_Indexed;
+  def int_aarch64_sve_bfmlalb_lane_v2 : Guarded_SVE_4Vec_BF16_Indexed;
+  def int_aarch64_sve_bfmlalt_lane_v2 : Guarded_SVE_4Vec_BF16_Indexed;
+}
 
 //
 // SVE2.1 - Contiguous loads to multiple consecutive vectors
 //
 
-  class SVE2p1_Load_PN_X2_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SVE2p1_Load_PN_X2_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                 [llvm_aarch64_svcount_ty, llvm_anyptr_ty],
                 [IntrReadMem, IntrArgMemOnly]>;
 
-  class SVE2p1_Load_PN_X4_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SVE2p1_Load_PN_X4_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
                              LLVMMatchType<0>, LLVMMatchType<0>],
                 [llvm_aarch64_svcount_ty, llvm_anyptr_ty],
                 [IntrReadMem, IntrArgMemOnly]>;
 
-def int_aarch64_sve_ld1_pn_x2 : SVE2p1_Load_PN_X2_Intrinsic;
-def int_aarch64_sve_ld1_pn_x4 : SVE2p1_Load_PN_X4_Intrinsic;
-def int_aarch64_sve_ldnt1_pn_x2 : SVE2p1_Load_PN_X2_Intrinsic;
-def int_aarch64_sve_ldnt1_pn_x4 : SVE2p1_Load_PN_X4_Intrinsic;
+let TargetGuards = [Variant<"sve2p1", "sve2p1|sme2", PackedDataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_ld1_pn_x2 : Guarded_SVE2p1_Load_PN_X2_Intrinsic;
+  def int_aarch64_sve_ld1_pn_x4 : Guarded_SVE2p1_Load_PN_X4_Intrinsic;
+  def int_aarch64_sve_ldnt1_pn_x2 : Guarded_SVE2p1_Load_PN_X2_Intrinsic;
+  def int_aarch64_sve_ldnt1_pn_x4 : Guarded_SVE2p1_Load_PN_X4_Intrinsic;
+}
 
 //
 // SVE2.1 - Contiguous loads to quadword (single vector)
 //
 
-class SVE2p1_Single_Load_Quadword
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+class Guarded_SVE2p1_Single_Load_Quadword
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                             [llvm_nxv1i1_ty, llvm_anyptr_ty],
                             [IntrReadMem, IntrArgMemOnly]>;
-def int_aarch64_sve_ld1uwq : SVE2p1_Single_Load_Quadword;
-def int_aarch64_sve_ld1udq : SVE2p1_Single_Load_Quadword;
+let TargetGuards = [NonStreamingVariant<"sve2p1", F32PTR_I32PTR_OverloadPair>] in
+def int_aarch64_sve_ld1uwq : Guarded_SVE2p1_Single_Load_Quadword;
+let TargetGuards = [NonStreamingVariant<"sve2p1", F64PTR_I64PTR_OverloadPair>] in
+def int_aarch64_sve_ld1udq : Guarded_SVE2p1_Single_Load_Quadword;
 
 //
 // SVE2.1 - Contiguous store from quadword (single vector)
 //
 
-class SVE2p1_Single_Store_Quadword
-    : DefaultAttrsIntrinsic<[],
+class Guarded_SVE2p1_Single_Store_Quadword
+    : GuardedDefaultIntrinsic<[],
                             [llvm_anyvector_ty, llvm_nxv1i1_ty, llvm_anyptr_ty],
                             [IntrWriteMem, IntrArgMemOnly]>;
-def int_aarch64_sve_st1wq : SVE2p1_Single_Store_Quadword;
-def int_aarch64_sve_st1dq : SVE2p1_Single_Store_Quadword;
-
-
-def int_aarch64_sve_ld2q_sret : AdvSIMD_2Vec_PredLoad_Intrinsic;
-def int_aarch64_sve_ld3q_sret : AdvSIMD_3Vec_PredLoad_Intrinsic;
-def int_aarch64_sve_ld4q_sret : AdvSIMD_4Vec_PredLoad_Intrinsic;
-
-def int_aarch64_sve_st2q : AdvSIMD_2Vec_PredStore_Intrinsic;
-def int_aarch64_sve_st3q : AdvSIMD_3Vec_PredStore_Intrinsic;
-def int_aarch64_sve_st4q : AdvSIMD_4Vec_PredStore_Intrinsic;
+let TargetGuards = [NonStreamingVariant<"sve2p1", F32PTR_I32PTR_OverloadPair>] in
+def int_aarch64_sve_st1wq : Guarded_SVE2p1_Single_Store_Quadword;
+
+let TargetGuards = [NonStreamingVariant<"sve2p1", F64PTR_I64PTR_OverloadPair>] in
+def int_aarch64_sve_st1dq : Guarded_SVE2p1_Single_Store_Quadword;
+
+let TargetGuards = [
+  Variant<"sve,(sve2p1|sme2p1)", "sve2p1|sme2p1", PackedDataPTR_OverloadPairs>,
+] in {
+  def int_aarch64_sve_ld2q_sret : Guarded_AdvSIMD_2Vec_PredLoad_Intrinsic;
+  def int_aarch64_sve_ld3q_sret : Guarded_AdvSIMD_3Vec_PredLoad_Intrinsic;
+  def int_aarch64_sve_ld4q_sret : Guarded_AdvSIMD_4Vec_PredLoad_Intrinsic;
+  def int_aarch64_sve_st2q : Guarded_AdvSIMD_2Vec_PredStore_Intrinsic;
+  def int_aarch64_sve_st3q : Guarded_AdvSIMD_3Vec_PredStore_Intrinsic;
+  def int_aarch64_sve_st4q : Guarded_AdvSIMD_4Vec_PredStore_Intrinsic;
+}
 
 //
 // SVE2.1 - Contiguous stores to multiple consecutive vectors
 //
 
-  class SVE2p1_Store_PN_X2_Intrinsic
-    : DefaultAttrsIntrinsic<[], [ llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SVE2p1_Store_PN_X2_Intrinsic
+    : GuardedDefaultIntrinsic<[], [ llvm_anyvector_ty, LLVMMatchType<0>,
                                   llvm_aarch64_svcount_ty, llvm_anyptr_ty ],
                 [IntrWriteMem, IntrArgMemOnly]>;
 
-  class SVE2p1_Store_PN_X4_Intrinsic
-    : DefaultAttrsIntrinsic<[], [ llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SVE2p1_Store_PN_X4_Intrinsic
+    : GuardedDefaultIntrinsic<[], [ llvm_anyvector_ty, LLVMMatchType<0>,
                                   LLVMMatchType<0>, LLVMMatchType<0>,
                                   llvm_aarch64_svcount_ty, llvm_anyptr_ty],
                 [IntrWriteMem, IntrArgMemOnly]>;
 
-def int_aarch64_sve_st1_pn_x2 : SVE2p1_Store_PN_X2_Intrinsic;
-def int_aarch64_sve_st1_pn_x4 : SVE2p1_Store_PN_X4_Intrinsic;
-def int_aarch64_sve_stnt1_pn_x2 : SVE2p1_Store_PN_X2_Intrinsic;
-def int_aarch64_sve_stnt1_pn_x4 : SVE2p1_Store_PN_X4_Intrinsic;
+let TargetGuards = [Variant<"sve2p1", "sve2p1|sme2", PackedDataPTR_OverloadPairs>] in {
+  def int_aarch64_sve_st1_pn_x2 : Guarded_SVE2p1_Store_PN_X2_Intrinsic;
+  def int_aarch64_sve_st1_pn_x4 : Guarded_SVE2p1_Store_PN_X4_Intrinsic;
+  def int_aarch64_sve_stnt1_pn_x2 : Guarded_SVE2p1_Store_PN_X2_Intrinsic;
+  def int_aarch64_sve_stnt1_pn_x4 : Guarded_SVE2p1_Store_PN_X4_Intrinsic;
+}
 }
 
 //
 // SVE2 - Contiguous conflict detection
 //
 
-def int_aarch64_sve_whilerw_b : SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilerw_h : SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilerw_s : SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilerw_d : SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilewr_b : SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilewr_h : SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilewr_s : SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_whilewr_d : SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2|sme)", "sme", PredicatePTR_OverloadPairs>] in {
+  def int_aarch64_sve_whilerw_b : Guarded_SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilerw_h : Guarded_SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilerw_s : Guarded_SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilerw_d : Guarded_SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilewr_b : Guarded_SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilewr_h : Guarded_SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilewr_s : Guarded_SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_whilewr_d : Guarded_SVE2_CONFLICT_DETECT_Intrinsic<[IntrSpeculatable]>;
+}
 
 // Scalable Matrix Extension (SME) Intrinsics
 let TargetPrefix = "aarch64" in {
-  class SME_Load_Intrinsic<LLVMType pred_ty>
-    : DefaultAttrsIntrinsic<[],
+  class Guarded_SME_Load_Intrinsic<LLVMType pred_ty>
+    : GuardedDefaultIntrinsic<[],
         [pred_ty, llvm_anyptr_ty, llvm_i32_ty, llvm_i32_ty],
         [IntrRead<[ArgMem, ZA]>, IntrWrite<[ZA]>,
          ImmArg<ArgIndex<2>>]>;
-  class SME_Store_Intrinsic<LLVMType pred_ty>
-    : DefaultAttrsIntrinsic<[],
+  class Guarded_SME_Store_Intrinsic<LLVMType pred_ty>
+    : GuardedDefaultIntrinsic<[],
         [pred_ty, llvm_anyptr_ty, llvm_i32_ty, llvm_i32_ty],
         [IntrRead<[ZA]>, IntrWrite<[ArgMem, ZA]>,
          ImmArg<ArgIndex<2>>]>;
 
   // Loads
-  def int_aarch64_sme_ld1b_horiz : SME_Load_Intrinsic<llvm_nxv16i1_ty>;
-  def int_aarch64_sme_ld1h_horiz : SME_Load_Intrinsic<llvm_nxv8i1_ty>;
-  def int_aarch64_sme_ld1w_horiz : SME_Load_Intrinsic<llvm_nxv4i1_ty>;
-  def int_aarch64_sme_ld1d_horiz : SME_Load_Intrinsic<llvm_nxv2i1_ty>;
-  def int_aarch64_sme_ld1q_horiz : SME_Load_Intrinsic<llvm_nxv1i1_ty>;
-  def int_aarch64_sme_ld1b_vert  : SME_Load_Intrinsic<llvm_nxv16i1_ty>;
-  def int_aarch64_sme_ld1h_vert  : SME_Load_Intrinsic<llvm_nxv8i1_ty>;
-  def int_aarch64_sme_ld1w_vert  : SME_Load_Intrinsic<llvm_nxv4i1_ty>;
-  def int_aarch64_sme_ld1d_vert  : SME_Load_Intrinsic<llvm_nxv2i1_ty>;
-  def int_aarch64_sme_ld1q_vert  : SME_Load_Intrinsic<llvm_nxv1i1_ty>;
+  let TargetGuards = [StreamingVariant<"sme", PTR_Overloads>] in {
+    def int_aarch64_sme_ld1b_horiz : Guarded_SME_Load_Intrinsic<llvm_nxv16i1_ty>;
+    def int_aarch64_sme_ld1h_horiz : Guarded_SME_Load_Intrinsic<llvm_nxv8i1_ty>;
+    def int_aarch64_sme_ld1w_horiz : Guarded_SME_Load_Intrinsic<llvm_nxv4i1_ty>;
+    def int_aarch64_sme_ld1d_horiz : Guarded_SME_Load_Intrinsic<llvm_nxv2i1_ty>;
+    def int_aarch64_sme_ld1q_horiz : Guarded_SME_Load_Intrinsic<llvm_nxv1i1_ty>;
+    def int_aarch64_sme_ld1b_vert  : Guarded_SME_Load_Intrinsic<llvm_nxv16i1_ty>;
+    def int_aarch64_sme_ld1h_vert  : Guarded_SME_Load_Intrinsic<llvm_nxv8i1_ty>;
+    def int_aarch64_sme_ld1w_vert  : Guarded_SME_Load_Intrinsic<llvm_nxv4i1_ty>;
+    def int_aarch64_sme_ld1d_vert  : Guarded_SME_Load_Intrinsic<llvm_nxv2i1_ty>;
+    def int_aarch64_sme_ld1q_vert  : Guarded_SME_Load_Intrinsic<llvm_nxv1i1_ty>;
+  }
 
   // Stores
-  def int_aarch64_sme_st1b_horiz : SME_Store_Intrinsic<llvm_nxv16i1_ty>;
-  def int_aarch64_sme_st1h_horiz : SME_Store_Intrinsic<llvm_nxv8i1_ty>;
-  def int_aarch64_sme_st1w_horiz : SME_Store_Intrinsic<llvm_nxv4i1_ty>;
-  def int_aarch64_sme_st1d_horiz : SME_Store_Intrinsic<llvm_nxv2i1_ty>;
-  def int_aarch64_sme_st1q_horiz : SME_Store_Intrinsic<llvm_nxv1i1_ty>;
-  def int_aarch64_sme_st1b_vert  : SME_Store_Intrinsic<llvm_nxv16i1_ty>;
-  def int_aarch64_sme_st1h_vert  : SME_Store_Intrinsic<llvm_nxv8i1_ty>;
-  def int_aarch64_sme_st1w_vert  : SME_Store_Intrinsic<llvm_nxv4i1_ty>;
-  def int_aarch64_sme_st1d_vert  : SME_Store_Intrinsic<llvm_nxv2i1_ty>;
-  def int_aarch64_sme_st1q_vert  : SME_Store_Intrinsic<llvm_nxv1i1_ty>;
+  let TargetGuards = [StreamingVariant<"sme", PTR_Overloads>] in {
+    def int_aarch64_sme_st1b_horiz : Guarded_SME_Store_Intrinsic<llvm_nxv16i1_ty>;
+    def int_aarch64_sme_st1h_horiz : Guarded_SME_Store_Intrinsic<llvm_nxv8i1_ty>;
+    def int_aarch64_sme_st1w_horiz : Guarded_SME_Store_Intrinsic<llvm_nxv4i1_ty>;
+    def int_aarch64_sme_st1d_horiz : Guarded_SME_Store_Intrinsic<llvm_nxv2i1_ty>;
+    def int_aarch64_sme_st1q_horiz : Guarded_SME_Store_Intrinsic<llvm_nxv1i1_ty>;
+    def int_aarch64_sme_st1b_vert  : Guarded_SME_Store_Intrinsic<llvm_nxv16i1_ty>;
+    def int_aarch64_sme_st1h_vert  : Guarded_SME_Store_Intrinsic<llvm_nxv8i1_ty>;
+    def int_aarch64_sme_st1w_vert  : Guarded_SME_Store_Intrinsic<llvm_nxv4i1_ty>;
+    def int_aarch64_sme_st1d_vert  : Guarded_SME_Store_Intrinsic<llvm_nxv2i1_ty>;
+    def int_aarch64_sme_st1q_vert  : Guarded_SME_Store_Intrinsic<llvm_nxv1i1_ty>;
+  }
 
   // Spill + fill
-  def int_aarch64_sme_ldr
-    : DefaultAttrsIntrinsic<[], [llvm_i32_ty, llvm_anyptr_ty, llvm_i32_ty],
+  let TargetGuards = [Variant<"sme", "sme", PTR_Overloads>] in {
+    def int_aarch64_sme_ldr
+    : GuardedDefaultIntrinsic<[], [llvm_i32_ty, llvm_anyptr_ty, llvm_i32_ty],
                             [IntrRead<[ArgMem, ZA]>, IntrWrite<[ZA]>]>;
-  def int_aarch64_sme_str
-    : DefaultAttrsIntrinsic<[], [llvm_i32_ty, llvm_anyptr_ty, llvm_i32_ty],
+    def int_aarch64_sme_str
+    : GuardedDefaultIntrinsic<[], [llvm_i32_ty, llvm_anyptr_ty, llvm_i32_ty],
                             [IntrRead<[ZA]>, IntrWrite<[ArgMem, ZA]>]>;
+  }
 
-
-  class SME_TileToVector_Intrinsic
-      : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SME_TileToVector_Intrinsic
+      : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
           [LLVMMatchType<0>, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
            llvm_i32_ty, llvm_i32_ty], [IntrRead<[ZA]>, IntrReadOnly,
                                         ImmArg<ArgIndex<2>>]>;
-  class SME_VectorToTile_Intrinsic
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_SME_VectorToTile_Intrinsic
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty, llvm_i32_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
            llvm_anyvector_ty], [IntrRead<[ZA]>, IntrWrite<[ZA]>,
                                 ImmArg<ArgIndex<0>>]>;
 
-  def int_aarch64_sme_read_horiz  : SME_TileToVector_Intrinsic;
-  def int_aarch64_sme_read_vert   : SME_TileToVector_Intrinsic;
-  def int_aarch64_sme_write_horiz : SME_VectorToTile_Intrinsic;
-  def int_aarch64_sme_write_vert  : SME_VectorToTile_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme", AllPackedData_Overloads>] in {
+    def int_aarch64_sme_read_horiz  : Guarded_SME_TileToVector_Intrinsic;
+    def int_aarch64_sme_read_vert   : Guarded_SME_TileToVector_Intrinsic;
+    def int_aarch64_sme_write_horiz : Guarded_SME_VectorToTile_Intrinsic;
+    def int_aarch64_sme_write_vert  : Guarded_SME_VectorToTile_Intrinsic;
 
-  def int_aarch64_sme_readq_horiz  : SME_TileToVector_Intrinsic;
-  def int_aarch64_sme_readq_vert   : SME_TileToVector_Intrinsic;
-  def int_aarch64_sme_writeq_horiz : SME_VectorToTile_Intrinsic;
-  def int_aarch64_sme_writeq_vert  : SME_VectorToTile_Intrinsic;
+    def int_aarch64_sme_readq_horiz  : Guarded_SME_TileToVector_Intrinsic;
+    def int_aarch64_sme_readq_vert   : Guarded_SME_TileToVector_Intrinsic;
+    def int_aarch64_sme_writeq_horiz : Guarded_SME_VectorToTile_Intrinsic;
+    def int_aarch64_sme_writeq_vert  : Guarded_SME_VectorToTile_Intrinsic;
+  }
 
-  class SME_MOVAZ_TileToVector_X2_Intrinsic
-      : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SME_MOVAZ_TileToVector_X2_Intrinsic
+      : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
           [llvm_i32_ty, llvm_i32_ty],
           [IntrWrite<[ZA]>, IntrRead<[ZA]>, ImmArg<ArgIndex<0>>]>;
 
-  class SME_MOVAZ_TileToVector_X4_Intrinsic
-      : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SME_MOVAZ_TileToVector_X4_Intrinsic
+      : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
            LLVMMatchType<0>,LLVMMatchType<0>],
           [llvm_i32_ty, llvm_i32_ty],
           [IntrWrite<[ZA]>, IntrRead<[ZA]>, ImmArg<ArgIndex<0>>]>;
 
-  def int_aarch64_sme_readz_horiz_x2 : SME_MOVAZ_TileToVector_X2_Intrinsic;
-  def int_aarch64_sme_readz_vert_x2  : SME_MOVAZ_TileToVector_X2_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2p1", AllPackedData_Overloads>] in {
+    def int_aarch64_sme_readz_horiz_x2 : Guarded_SME_MOVAZ_TileToVector_X2_Intrinsic;
+    def int_aarch64_sme_readz_vert_x2  : Guarded_SME_MOVAZ_TileToVector_X2_Intrinsic;
 
-  def int_aarch64_sme_readz_horiz_x4 : SME_MOVAZ_TileToVector_X4_Intrinsic;
-  def int_aarch64_sme_readz_vert_x4  : SME_MOVAZ_TileToVector_X4_Intrinsic;
+    def int_aarch64_sme_readz_horiz_x4 : Guarded_SME_MOVAZ_TileToVector_X4_Intrinsic;
+    def int_aarch64_sme_readz_vert_x4  : Guarded_SME_MOVAZ_TileToVector_X4_Intrinsic;
+  }
 
-  class SME_MOVAZ_TileToVector_Intrinsic
-      : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SME_MOVAZ_TileToVector_Intrinsic
+      : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
           [llvm_i32_ty, llvm_i32_ty],
           [IntrWrite<[ZA]>, IntrRead<[ZA]>, ImmArg<ArgIndex<0>>]>;
 
-  def int_aarch64_sme_readz_horiz : SME_MOVAZ_TileToVector_Intrinsic;
-  def int_aarch64_sme_readz_vert  : SME_MOVAZ_TileToVector_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2p1", AllPackedData_Overloads>] in {
+    def int_aarch64_sme_readz_horiz : Guarded_SME_MOVAZ_TileToVector_Intrinsic;
+    def int_aarch64_sme_readz_vert  : Guarded_SME_MOVAZ_TileToVector_Intrinsic;
 
-  def int_aarch64_sme_readz_q_horiz : SME_MOVAZ_TileToVector_Intrinsic;
-  def int_aarch64_sme_readz_q_vert  : SME_MOVAZ_TileToVector_Intrinsic;
+    def int_aarch64_sme_readz_q_horiz : Guarded_SME_MOVAZ_TileToVector_Intrinsic;
+    def int_aarch64_sme_readz_q_vert  : Guarded_SME_MOVAZ_TileToVector_Intrinsic;
 
-  def int_aarch64_sme_readz_x2
-      : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+    def int_aarch64_sme_readz_x2
+      : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
           [llvm_i32_ty],
           [IntrWrite<[ZA]>, IntrRead<[ZA]>]>;
-
-  def int_aarch64_sme_readz_x4
-      : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
+    def int_aarch64_sme_readz_x4
+      : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
           [llvm_i32_ty],
           [IntrWrite<[ZA]>, IntrRead<[ZA]>]>;
+  }
 
-  def int_aarch64_sme_write_lane_zt
-       :  DefaultAttrsIntrinsic<[], [llvm_i32_ty, llvm_anyvector_ty, llvm_i32_ty],
+  let TargetGuards = [StreamingVariant<"sme-lutv2", AllPackedData_Overloads>] in {
+    def int_aarch64_sme_write_lane_zt
+       :  GuardedDefaultIntrinsic<[], [llvm_i32_ty, llvm_anyvector_ty, llvm_i32_ty],
             [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<2>>, IntrRead<[ZT0]>,
              IntrWrite<[ZT0]>]>;
-
-  def int_aarch64_sme_write_zt
-       :  DefaultAttrsIntrinsic<[], [llvm_i32_ty, llvm_anyvector_ty],
+    def int_aarch64_sme_write_zt
+       :  GuardedDefaultIntrinsic<[], [llvm_i32_ty, llvm_anyvector_ty],
             [ImmArg<ArgIndex<0>>, IntrWrite<[ZT0]>, IntrWriteOnly]>;
+  }
 
+  let TargetGuards = [Variant<"sme", "sme", EmptyOverload>] in {
+    def int_aarch64_sme_zero : GuardedDefaultIntrinsic<[], [llvm_i32_ty], [IntrWrite<[ZA]>, IntrWriteOnly, ImmArg<ArgIndex<0>>]>;
+    def int_aarch64_sme_in_streaming_mode : GuardedDefaultIntrinsic<[llvm_i1_ty], [], [IntrNoMem]>, ClangBuiltin<"__builtin_arm_in_streaming_mode">;
+  }
 
-  def int_aarch64_sme_zero : DefaultAttrsIntrinsic<[], [llvm_i32_ty], [IntrWrite<[ZA]>, IntrWriteOnly, ImmArg<ArgIndex<0>>]>;
-  def int_aarch64_sme_in_streaming_mode : DefaultAttrsIntrinsic<[llvm_i1_ty], [], [IntrNoMem]>, ClangBuiltin<"__builtin_arm_in_streaming_mode">;
-
-  class SME_OuterProduct_Intrinsic
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_SME_OuterProduct_Intrinsic
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
            LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
            LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
@@ -3106,51 +3602,65 @@ let TargetPrefix = "aarch64" in {
            llvm_anyvector_ty], [IntrRead<[ZA]>, IntrWrite<[ZA]>,
                                 ImmArg<ArgIndex<0>>]>;
 
-  def int_aarch64_sme_mopa : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_mops : SME_OuterProduct_Intrinsic;
+  let TargetGuards = [
+    StreamingVariant<"sme-f64f64", F64_Overloads>,
+    StreamingVariant<"sme", F32_Overloads>,
+    StreamingVariant<"sme-b16b16", BF16_Overloads>,
+    StreamingVariant<"sme-f16f16", F16_Overloads>,
+  ] in {
+    def int_aarch64_sme_mopa : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_mops : Guarded_SME_OuterProduct_Intrinsic;
+  }
 
-  def int_aarch64_sme_mopa_wide : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_mops_wide : SME_OuterProduct_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme", BF16_F16_Overloads>] in {
+    def int_aarch64_sme_mopa_wide : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_mops_wide : Guarded_SME_OuterProduct_Intrinsic;
+  }
 
-  def int_aarch64_sme_smopa_wide  : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_smops_wide  : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_umopa_wide  : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_umops_wide  : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_sumopa_wide : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_sumops_wide : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_usmopa_wide : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_usmops_wide : SME_OuterProduct_Intrinsic;
+  let TargetGuards = [
+    StreamingVariant<"sme", I8_Overloads>,
+    StreamingVariant<"sme-i16i64", I16_Overloads>,
+  ] in {
+    def int_aarch64_sme_smopa_wide  : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_smops_wide  : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_umopa_wide  : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_umops_wide  : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_sumopa_wide : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_sumops_wide : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_usmopa_wide : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_usmops_wide : Guarded_SME_OuterProduct_Intrinsic;
+  }
 
-  class SME_OuterProduct_QuarterTile_Single_Single
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_SME_OuterProduct_QuarterTile_Single_Single
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
            llvm_anyvector_ty,
            LLVMMatchType<0>], [ImmArg<ArgIndex<0>>, IntrRead<[ZA]>,
                                IntrWrite<[ZA]>, IntrHasSideEffects]>;
 
- class SME_FP8_OuterProduct_QuarterTile_Single_Single
-      : DefaultAttrsIntrinsic<[],
+ class Guarded_SME_FP8_OuterProduct_QuarterTile_Single_Single
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
           llvm_anyvector_ty,
           LLVMMatchType<0>], [ImmArg<ArgIndex<0>>, IntrRead<[FPMR, ZA]>, IntrWrite<[ZA]>, IntrHasSideEffects]>;
 
-  class SME_OuterProduct_QuarterTile_Single_Multi
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_SME_OuterProduct_QuarterTile_Single_Multi
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
           llvm_anyvector_ty,
           LLVMMatchType<0>,
           LLVMMatchType<0>], [ImmArg<ArgIndex<0>>, IntrRead<[ZA]>,
                               IntrWrite<[ZA]>, IntrHasSideEffects]>;
 
-  class SME_FP8_OuterProduct_QuarterTile_Single_Multi
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_SME_FP8_OuterProduct_QuarterTile_Single_Multi
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
           llvm_anyvector_ty,
           LLVMMatchType<0>,
           LLVMMatchType<0>], [ImmArg<ArgIndex<0>>, IntrRead<[FPMR, ZA]>, IntrWrite<[ZA]>, IntrHasSideEffects]>;
 
-  class SME_OuterProduct_QuarterTile_Multi_Multi
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_SME_OuterProduct_QuarterTile_Multi_Multi
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
           llvm_anyvector_ty,
           LLVMMatchType<0>,
@@ -3158,8 +3668,8 @@ let TargetPrefix = "aarch64" in {
           LLVMMatchType<0>], [ImmArg<ArgIndex<0>>, IntrRead<[ZA]>,
                               IntrWrite<[ZA]>, IntrHasSideEffects]>;
 
-  class SME_FP8_OuterProduct_QuarterTile_Multi_Multi
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_SME_FP8_OuterProduct_QuarterTile_Multi_Multi
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
           llvm_anyvector_ty,
           LLVMMatchType<0>,
@@ -3167,29 +3677,61 @@ let TargetPrefix = "aarch64" in {
           LLVMMatchType<0>], [ImmArg<ArgIndex<0>>, IntrRead<[FPMR, ZA]>, IntrWrite<[ZA]>, IntrHasSideEffects]>;
 
   // 2-way and 4-way multi-vector signed/unsigned Quarter Tile Quarter Product A/S
-  foreach mode = ["s", "a"] in {
-    foreach za = ["", "_za64"] in {
-      foreach ty = ["s", "u", "su", "us"] in {
-        def int_aarch64_sme_ # ty # "mop4" # mode # za # "_wide_1x1" : SME_OuterProduct_QuarterTile_Single_Single;
-        def int_aarch64_sme_ # ty # "mop4" # mode # za # "_wide_1x2" : SME_OuterProduct_QuarterTile_Single_Multi;
-        def int_aarch64_sme_ # ty # "mop4" # mode # za # "_wide_2x1" : SME_OuterProduct_QuarterTile_Single_Multi;
-        def int_aarch64_sme_ # ty # "mop4" # mode # za # "_wide_2x2" : SME_OuterProduct_QuarterTile_Multi_Multi;
-      }
+  foreach op = ["smop4s", "umop4s", "smop4a", "umop4a"] in {
+    let TargetGuards = [StreamingVariant<"sme2,sme-mop4", I8_I16_Overloads>] in {
+      def int_aarch64_sme_ # op # _wide_1x1 : Guarded_SME_OuterProduct_QuarterTile_Single_Single;
+      def int_aarch64_sme_ # op # _wide_1x2 : Guarded_SME_OuterProduct_QuarterTile_Single_Multi;
+      def int_aarch64_sme_ # op # _wide_2x1 : Guarded_SME_OuterProduct_QuarterTile_Single_Multi;
+      def int_aarch64_sme_ # op # _wide_2x2 : Guarded_SME_OuterProduct_QuarterTile_Multi_Multi;
+    }
+  }
+
+  foreach op = ["sumop4s", "usmop4s", "sumop4a", "usmop4a"] in {
+    let TargetGuards = [StreamingVariant<"sme2,sme-mop4", I8_Overloads>] in {
+      def int_aarch64_sme_ # op # _wide_1x1 : Guarded_SME_OuterProduct_QuarterTile_Single_Single;
+      def int_aarch64_sme_ # op # _wide_1x2 : Guarded_SME_OuterProduct_QuarterTile_Single_Multi;
+      def int_aarch64_sme_ # op # _wide_2x1 : Guarded_SME_OuterProduct_QuarterTile_Single_Multi;
+      def int_aarch64_sme_ # op # _wide_2x2 : Guarded_SME_OuterProduct_QuarterTile_Multi_Multi;
+    }
+  }
+
+  foreach op = ["smop4s_za64", "umop4s_za64", "smop4a_za64", "umop4a_za64",
+                "sumop4s_za64", "usmop4s_za64", "sumop4a_za64",
+                "usmop4a_za64"] in {
+    let TargetGuards = [StreamingVariant<"sme2,sme-mop4,sme-i16i64", I16_Overloads>] in {
+      def int_aarch64_sme_ # op # _wide_1x1 : Guarded_SME_OuterProduct_QuarterTile_Single_Single;
+      def int_aarch64_sme_ # op # _wide_1x2 : Guarded_SME_OuterProduct_QuarterTile_Single_Multi;
+      def int_aarch64_sme_ # op # _wide_2x1 : Guarded_SME_OuterProduct_QuarterTile_Single_Multi;
+      def int_aarch64_sme_ # op # _wide_2x2 : Guarded_SME_OuterProduct_QuarterTile_Multi_Multi;
     }
   }
 
   // 2-way and 4-way multi-vector floating point Quarter Tile Quarter Product A/S
-  foreach mode = ["s", "a"] in {
-    foreach wide = ["", "_wide"] in {
-      def int_aarch64_sme_mop4 # mode # wide # "_1x1" : SME_OuterProduct_QuarterTile_Single_Single;
-      def int_aarch64_sme_mop4 # mode # wide # "_1x2" : SME_OuterProduct_QuarterTile_Single_Multi;
-      def int_aarch64_sme_mop4 # mode # wide # "_2x1" : SME_OuterProduct_QuarterTile_Single_Multi;
-      def int_aarch64_sme_mop4 # mode # wide # "_2x2" : SME_OuterProduct_QuarterTile_Multi_Multi;
+  foreach op = ["mop4s", "mop4a"] in {
+    let TargetGuards = [
+      StreamingVariant<"sme2,sme-mop4,sme-f64f64", F64_Overloads>,
+      StreamingVariant<"sme2,sme-mop4", F32_Overloads>,
+      StreamingVariant<"sme2,sme-mop4,sme-b16b16", BF16_Overloads>,
+      StreamingVariant<"sme2,sme-mop4,sme-f16f16", F16_Overloads>,
+    ] in {
+      def int_aarch64_sme_ # op # _1x1 : Guarded_SME_OuterProduct_QuarterTile_Single_Single;
+      def int_aarch64_sme_ # op # _1x2 : Guarded_SME_OuterProduct_QuarterTile_Single_Multi;
+      def int_aarch64_sme_ # op # _2x1 : Guarded_SME_OuterProduct_QuarterTile_Single_Multi;
+      def int_aarch64_sme_ # op # _2x2 : Guarded_SME_OuterProduct_QuarterTile_Multi_Multi;
     }
   }
 
-  class SME_OuterProduct_TMOP_Intrinsic
-     : DefaultAttrsIntrinsic<[],
+  foreach op = ["mop4s_wide", "mop4a_wide"] in {
+    let TargetGuards = [StreamingVariant<"sme2,sme-mop4", BF16_F16_Overloads>] in {
+      def int_aarch64_sme_ # op # _1x1 : Guarded_SME_OuterProduct_QuarterTile_Single_Single;
+      def int_aarch64_sme_ # op # _1x2 : Guarded_SME_OuterProduct_QuarterTile_Single_Multi;
+      def int_aarch64_sme_ # op # _2x1 : Guarded_SME_OuterProduct_QuarterTile_Single_Multi;
+      def int_aarch64_sme_ # op # _2x2 : Guarded_SME_OuterProduct_QuarterTile_Multi_Multi;
+    }
+  }
+
+  class Guarded_SME_OuterProduct_TMOP_Intrinsic
+     : GuardedDefaultIntrinsic<[],
          [llvm_i32_ty,
           llvm_anyvector_ty,
           LLVMMatchType<0>,
@@ -3199,15 +3741,24 @@ let TargetPrefix = "aarch64" in {
          [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<5>>, IntrRead<[ZA]>,
           IntrWrite<[ZA]>]>;
 
-  def int_aarch64_sme_ftmopa_za16 : SME_OuterProduct_TMOP_Intrinsic;
-  def int_aarch64_sme_ftmopa_za32 : SME_OuterProduct_TMOP_Intrinsic;
-  def int_aarch64_sme_stmopa_za32 : SME_OuterProduct_TMOP_Intrinsic;
-  def int_aarch64_sme_utmopa_za32 : SME_OuterProduct_TMOP_Intrinsic;
-  def int_aarch64_sme_sutmopa_za32 : SME_OuterProduct_TMOP_Intrinsic;
-  def int_aarch64_sme_ustmopa_za32 : SME_OuterProduct_TMOP_Intrinsic;
+  let TargetGuards = [
+    StreamingVariant<"sme2,sme-tmop,sme-b16b16", BF16_Overloads>,
+    StreamingVariant<"sme2,sme-tmop,sme-f16f16", F16_Overloads>,
+  ] in
+  def int_aarch64_sme_ftmopa_za16 : Guarded_SME_OuterProduct_TMOP_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2,sme-tmop", BF16_F16_F32_Overloads>] in
+  def int_aarch64_sme_ftmopa_za32 : Guarded_SME_OuterProduct_TMOP_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2,sme-tmop", I8_I16_Overloads>] in {
+    def int_aarch64_sme_stmopa_za32 : Guarded_SME_OuterProduct_TMOP_Intrinsic;
+    def int_aarch64_sme_utmopa_za32 : Guarded_SME_OuterProduct_TMOP_Intrinsic;
+  }
+  let TargetGuards = [StreamingVariant<"sme2,sme-tmop", I8_Overloads>] in {
+    def int_aarch64_sme_sutmopa_za32 : Guarded_SME_OuterProduct_TMOP_Intrinsic;
+    def int_aarch64_sme_ustmopa_za32 : Guarded_SME_OuterProduct_TMOP_Intrinsic;
+  }
 
-  class SME_FP8_OuterProduct_TMOP_Intrinsic
-     : DefaultAttrsIntrinsic<[],
+  class Guarded_SME_FP8_OuterProduct_TMOP_Intrinsic
+     : GuardedDefaultIntrinsic<[],
          [llvm_i32_ty,
           llvm_nxv16i8_ty,
           llvm_nxv16i8_ty,
@@ -3217,65 +3768,103 @@ let TargetPrefix = "aarch64" in {
          [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<5>>,
           IntrRead<[ZA, FPMR]>, IntrWrite<[ZA]>]>;
 
-  def int_aarch64_sme_fp8_ftmopa_za16 : SME_FP8_OuterProduct_TMOP_Intrinsic;
-  def int_aarch64_sme_fp8_ftmopa_za32 : SME_FP8_OuterProduct_TMOP_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2,sme-tmop,sme-f8f16", EmptyOverload>] in
+  def int_aarch64_sme_fp8_ftmopa_za16 : Guarded_SME_FP8_OuterProduct_TMOP_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2,sme-tmop,sme-f8f32", EmptyOverload>] in
+  def int_aarch64_sme_fp8_ftmopa_za32 : Guarded_SME_FP8_OuterProduct_TMOP_Intrinsic;
 
   // 16 and 32 bit multi-vector floating point 8 Quarter Tile Quarter Product
-  foreach za = ["za16", "za32"] in {
-    def int_aarch64_sme_fp8_fmop4a_ # za # "_1x1" : SME_FP8_OuterProduct_QuarterTile_Single_Single;
-    def int_aarch64_sme_fp8_fmop4a_ # za # "_1x2" : SME_FP8_OuterProduct_QuarterTile_Single_Multi;
-    def int_aarch64_sme_fp8_fmop4a_ # za # "_2x1" : SME_FP8_OuterProduct_QuarterTile_Single_Multi;
-    def int_aarch64_sme_fp8_fmop4a_ # za # "_2x2" : SME_FP8_OuterProduct_QuarterTile_Multi_Multi;
+  let TargetGuards = [StreamingVariant<"sme2,sme-mop4,sme-f8f16", I8_Overloads>] in {
+    def int_aarch64_sme_fp8_fmop4a_za16_1x1 : Guarded_SME_FP8_OuterProduct_QuarterTile_Single_Single;
+    def int_aarch64_sme_fp8_fmop4a_za16_1x2 : Guarded_SME_FP8_OuterProduct_QuarterTile_Single_Multi;
+    def int_aarch64_sme_fp8_fmop4a_za16_2x1 : Guarded_SME_FP8_OuterProduct_QuarterTile_Single_Multi;
+
+    def int_aarch64_sme_fp8_fmop4a_za16_2x2 : Guarded_SME_FP8_OuterProduct_QuarterTile_Multi_Multi;
   }
 
-  class SME_AddVectorToTile_Intrinsic
-      : DefaultAttrsIntrinsic<[],
+  let TargetGuards = [StreamingVariant<"sme2,sme-mop4,sme-f8f32", I8_Overloads>] in {
+    def int_aarch64_sme_fp8_fmop4a_za32_1x1 : Guarded_SME_FP8_OuterProduct_QuarterTile_Single_Single;
+    def int_aarch64_sme_fp8_fmop4a_za32_1x2 : Guarded_SME_FP8_OuterProduct_QuarterTile_Single_Multi;
+    def int_aarch64_sme_fp8_fmop4a_za32_2x1 : Guarded_SME_FP8_OuterProduct_QuarterTile_Single_Multi;
+
+    def int_aarch64_sme_fp8_fmop4a_za32_2x2 : Guarded_SME_FP8_OuterProduct_QuarterTile_Multi_Multi;
+  }
+
+  class Guarded_SME_AddVectorToTile_Intrinsic
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
            LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
            LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
            llvm_anyvector_ty], [IntrRead<[ZA]>, IntrWrite<[ZA]>,
                                 ImmArg<ArgIndex<0>>]>;
 
-  def int_aarch64_sme_addha : SME_AddVectorToTile_Intrinsic;
-  def int_aarch64_sme_addva : SME_AddVectorToTile_Intrinsic;
+  let TargetGuards = [
+    StreamingVariant<"sme-i16i64", I64_Overloads>,
+    StreamingVariant<"sme", I32_Overloads>,
+  ] in {
+    def int_aarch64_sme_addha : Guarded_SME_AddVectorToTile_Intrinsic;
+    def int_aarch64_sme_addva : Guarded_SME_AddVectorToTile_Intrinsic;
+  }
 
   //
   // Counting elements
   //
 
+  let TargetGuards = [Variant<"sme", "sme", EmptyOverload>] in
   def int_aarch64_sme_cntsd
-      : DefaultAttrsIntrinsic<[llvm_i64_ty], [], [IntrNoMem]>;
+      : GuardedDefaultIntrinsic<[llvm_i64_ty], [], [IntrNoMem]>;
 
   // Clamp
   //
 
-  def int_aarch64_sve_sclamp : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-  def int_aarch64_sve_uclamp : AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
-  def int_aarch64_sve_fclamp : AdvSIMD_3VectorArg_Intrinsic;
-
+  let TargetGuards = [Variant<"sve,(sve2p1|sme)", "sme", I8_I16_I32_I64_Overloads>] in {
+    def int_aarch64_sve_sclamp : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+    def int_aarch64_sve_uclamp : Guarded_AdvSIMD_3VectorArg_Intrinsic<[IntrSpeculatable]>;
+  }
+  let TargetGuards = [
+    Variant<"sve,(sve2p1|sme2)", "sve2p1|sme2", F32_F64_Overloads>,
+    Variant<"sve,sve-b16b16", "sme2,sve-b16b16", BF16_Overloads>,
+    Variant<"sve,(sve2p1|sme2)", "sve2p1|sme2", F16_Overloads>,
+  ] in
+  def int_aarch64_sve_fclamp : Guarded_AdvSIMD_3VectorArg_Intrinsic;
 
   //
   // Reversal
   //
 
-  def int_aarch64_sve_revd : AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
+  let TargetGuards = [Variant<"sve,(sve2p1|sme)", "sme", AllPackedData_Overloads>] in
+  def int_aarch64_sve_revd : Guarded_AdvSIMD_Merged1VectorArg_Intrinsic<[IntrSpeculatable]>;
 
   //
   // Predicate selection
   //
 
+  defvar SvePSelTypes = [
+    [llvm_nxv16i1_ty, llvm_nxv16i1_ty],
+    [llvm_nxv16i1_ty, llvm_nxv8i1_ty],
+    [llvm_nxv16i1_ty, llvm_nxv4i1_ty],
+    [llvm_nxv16i1_ty, llvm_nxv2i1_ty],
+  ];
+  defvar Sve2p1PSelTypes = [
+    [llvm_aarch64_svcount_ty, llvm_nxv16i1_ty],
+    [llvm_aarch64_svcount_ty, llvm_nxv8i1_ty],
+    [llvm_aarch64_svcount_ty, llvm_nxv4i1_ty],
+    [llvm_aarch64_svcount_ty, llvm_nxv2i1_ty],
+  ];
+  let TargetGuards = [Variant<"sve,(sve2p1|sme)", "sve2p1|sme", SvePSelTypes>,
+                      Variant<"sve,(sve2p1|sme2)", "sve2p1|sme2", Sve2p1PSelTypes>] in
   def int_aarch64_sve_psel
-      : DefaultAttrsIntrinsic<[llvm_any_ty],
-                              [LLVMMatchType<0>,
-                               llvm_anyvector_ty, llvm_i32_ty],
-                              [IntrNoMem]>;
+      : GuardedDefaultIntrinsic<[llvm_any_ty],
+                                     [LLVMMatchType<0>, llvm_anyvector_ty, llvm_i32_ty],
+                                     [IntrNoMem]>;
 
   //
   // Predicate-pair intrinsics
   //
   foreach cmp = ["ge", "gt", "hi", "hs", "le", "lo", "ls", "lt"] in {
+    let TargetGuards = [Variant<"sve,(sve2p1|sme2)", "sve2p1|sme2", Predicate_Overloads>] in
     def int_aarch64_sve_while # cmp # _x2
-        : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+        : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                                 [llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>;
   }
 
@@ -3283,43 +3872,47 @@ let TargetPrefix = "aarch64" in {
   // Predicate-as-counter intrinsics
   //
 
-  def int_aarch64_sve_pext
-      : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  let TargetGuards = [Variant<"sve2p1", "sve2p1|sme2", Predicate_Overloads>] in {
+    def int_aarch64_sve_pext
+      : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                               [llvm_aarch64_svcount_ty, llvm_i32_ty],
                               [IntrNoMem, ImmArg<ArgIndex<1>>]>;
-
-  def int_aarch64_sve_pext_x2
-      : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+    def int_aarch64_sve_pext_x2
+      : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                               [llvm_aarch64_svcount_ty, llvm_i32_ty],
                               [IntrNoMem, ImmArg<ArgIndex<1>>]>;
+  }
 
-  def int_aarch64_sve_ptrue_c8
-      : DefaultAttrsIntrinsic<[llvm_aarch64_svcount_ty], [], [IntrNoMem]>;
-  def int_aarch64_sve_ptrue_c16
-      : DefaultAttrsIntrinsic<[llvm_aarch64_svcount_ty], [], [IntrNoMem]>;
-  def int_aarch64_sve_ptrue_c32
-      : DefaultAttrsIntrinsic<[llvm_aarch64_svcount_ty], [], [IntrNoMem]>;
-  def int_aarch64_sve_ptrue_c64
-      : DefaultAttrsIntrinsic<[llvm_aarch64_svcount_ty], [], [IntrNoMem]>;
-
-  def int_aarch64_sve_cntp_c8
-      : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_aarch64_svcount_ty, llvm_i32_ty],
+  let TargetGuards = [Variant<"sve2p1", "sve2p1|sme2", EmptyOverload>] in {
+    def int_aarch64_sve_ptrue_c8
+      : GuardedDefaultIntrinsic<[llvm_aarch64_svcount_ty], [], [IntrNoMem]>;
+    def int_aarch64_sve_ptrue_c16
+      : GuardedDefaultIntrinsic<[llvm_aarch64_svcount_ty], [], [IntrNoMem]>;
+    def int_aarch64_sve_ptrue_c32
+      : GuardedDefaultIntrinsic<[llvm_aarch64_svcount_ty], [], [IntrNoMem]>;
+    def int_aarch64_sve_ptrue_c64
+      : GuardedDefaultIntrinsic<[llvm_aarch64_svcount_ty], [], [IntrNoMem]>;
+
+    def int_aarch64_sve_cntp_c8
+      : GuardedDefaultIntrinsic<[llvm_i64_ty], [llvm_aarch64_svcount_ty, llvm_i32_ty],
                               [IntrNoMem, ImmArg<ArgIndex<1>>]>;
-  def int_aarch64_sve_cntp_c16
-      : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_aarch64_svcount_ty, llvm_i32_ty],
+    def int_aarch64_sve_cntp_c16
+      : GuardedDefaultIntrinsic<[llvm_i64_ty], [llvm_aarch64_svcount_ty, llvm_i32_ty],
                               [IntrNoMem, ImmArg<ArgIndex<1>>]>;
-  def int_aarch64_sve_cntp_c32
-      : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_aarch64_svcount_ty, llvm_i32_ty],
+    def int_aarch64_sve_cntp_c32
+      : GuardedDefaultIntrinsic<[llvm_i64_ty], [llvm_aarch64_svcount_ty, llvm_i32_ty],
                               [IntrNoMem, ImmArg<ArgIndex<1>>]>;
-  def int_aarch64_sve_cntp_c64
-      : DefaultAttrsIntrinsic<[llvm_i64_ty], [llvm_aarch64_svcount_ty, llvm_i32_ty],
+    def int_aarch64_sve_cntp_c64
+      : GuardedDefaultIntrinsic<[llvm_i64_ty], [llvm_aarch64_svcount_ty, llvm_i32_ty],
                               [IntrNoMem, ImmArg<ArgIndex<1>>]>;
+  }
 
   // While (predicate-as-counter) intrinsics
   foreach cmp = ["ge", "gt", "hi", "hs", "le", "lo", "ls", "lt"] in {
     foreach ty = ["c8", "c16", "c32", "c64"] in {
+      let TargetGuards = [Variant<"sve2p1", "sve2p1|sme2", EmptyOverload>] in
       def int_aarch64_sve_while # cmp # _ # ty
-          : DefaultAttrsIntrinsic<[llvm_aarch64_svcount_ty],
+          : GuardedDefaultIntrinsic<[llvm_aarch64_svcount_ty],
                                   [llvm_i64_ty, llvm_i64_ty, llvm_i32_ty],
                                   [IntrNoMem, ImmArg<ArgIndex<2>>]>;
     }
@@ -3329,132 +3922,132 @@ let TargetPrefix = "aarch64" in {
   // SME2 Intrinsics
   //
 
-  class SME2_Matrix_ArrayVector_Single_Single_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Matrix_ArrayVector_Single_Single_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                 [llvm_i32_ty,
                  llvm_anyvector_ty, LLVMMatchType<0>],
                 [IntrRead<[ZA]>, IntrWrite<[ZA]>]>;
 
-  class SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                 [llvm_i32_ty,
                  llvm_anyvector_ty, LLVMMatchType<0>,
                  LLVMMatchType<0>],
                 [IntrRead<[ZA]>, IntrWrite<[ZA]>]>;
 
-  class SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                 [llvm_i32_ty,
                  llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMMatchType<0>],
                 [IntrRead<[ZA]>, IntrWrite<[ZA]>]>;
 
-  class SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                 [llvm_i32_ty,
                  llvm_anyvector_ty, LLVMMatchType<0>,
                  LLVMMatchType<0>, LLVMMatchType<0>],
                 [IntrRead<[ZA]>, IntrWrite<[ZA]>]>;
 
-  class SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                 [llvm_i32_ty,
                  llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
                 [IntrRead<[ZA]>, IntrWrite<[ZA]>]>;
 
-  class SME2_Matrix_ArrayVector_Single_Index_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Matrix_ArrayVector_Single_Index_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                 [llvm_i32_ty,
                 llvm_anyvector_ty,
                 LLVMMatchType<0>, llvm_i32_ty],
                 [IntrRead<[ZA]>, IntrWrite<[ZA]>,
                  ImmArg<ArgIndex<3>>]>;
 
-  class SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                 [llvm_i32_ty,
                  llvm_anyvector_ty, LLVMMatchType<0>,
                  LLVMMatchType<0>, llvm_i32_ty],
                 [IntrRead<[ZA]>, IntrWrite<[ZA]>,
                  ImmArg<ArgIndex<4>>]>;
 
-  class SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic
-    : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic
+    : GuardedDefaultIntrinsic<[],
                 [llvm_i32_ty,
                  llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMMatchType<0>, llvm_i32_ty],
                 [IntrRead<[ZA]>, IntrWrite<[ZA]>,
                  ImmArg<ArgIndex<6>>]>;
 
-  class SVE2_VG2_Multi_Imm_Intrinsic
-    : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
+  class Guarded_SVE2_VG2_Multi_Imm_Intrinsic
+    : GuardedDefaultIntrinsic<[LLVMSubdivide2VectorType<0>],
                 [llvm_anyvector_ty, LLVMMatchType<0>,
                  llvm_i32_ty],
                 [IntrNoMem, ImmArg<ArgIndex<2>>]>;
 
-  class SVE2_VG4_Multi_Imm_Intrinsic
-    : DefaultAttrsIntrinsic<[LLVMSubdivide4VectorType<0>],
+  class Guarded_SVE2_VG4_Multi_Imm_Intrinsic
+    : GuardedDefaultIntrinsic<[LLVMSubdivide4VectorType<0>],
                 [llvm_anyvector_ty, LLVMMatchType<0>,
                  LLVMMatchType<0>, LLVMMatchType<0>,
                  llvm_i32_ty],
                 [IntrNoMem, ImmArg<ArgIndex<4>>]>;
 
-  class SME2_ZA_Write_VG2_Intrinsic
-   : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_ZA_Write_VG2_Intrinsic
+   : GuardedDefaultIntrinsic<[],
                [llvm_i32_ty,
                 llvm_anyvector_ty, LLVMMatchType<0>],
                [IntrRead<[ZA]>, IntrWrite<[ZA]>]>;
 
-  class SME2_ZA_Write_VG4_Intrinsic
-   : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_ZA_Write_VG4_Intrinsic
+   : GuardedDefaultIntrinsic<[],
                [llvm_i32_ty,
                 llvm_anyvector_ty, LLVMMatchType<0>,
                 LLVMMatchType<0>,  LLVMMatchType<0>],
                [IntrRead<[ZA]>, IntrWrite<[ZA]>]>;
 
-  class SVE2_VG2_Multi_Single_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SVE2_VG2_Multi_Single_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                 [LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMMatchType<0>],
                 [IntrNoMem]>;
 
-  class SVE2_VG2_Multi_Single_Scale_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SVE2_VG2_Multi_Single_Scale_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                 [LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMVectorOfBitcastsToInt<0>],
                 [IntrNoMem]>;
 
-  class SVE2_VG4_Multi_Single_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SVE2_VG4_Multi_Single_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
                              LLVMMatchType<0>,  LLVMMatchType<0>],
                             [LLVMMatchType<0>,  LLVMMatchType<0>,
                              LLVMMatchType<0>,  LLVMMatchType<0>,
                              LLVMMatchType<0>],
                             [IntrNoMem]>;
 
-  class SVE2_VG4_Multi_Single_Scale_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SVE2_VG4_Multi_Single_Scale_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
                              LLVMMatchType<0>,  LLVMMatchType<0>],
                             [LLVMMatchType<0>,  LLVMMatchType<0>,
                              LLVMMatchType<0>,  LLVMMatchType<0>,
                              LLVMVectorOfBitcastsToInt<0>],
                             [IntrNoMem]>;
 
-  class SVE2_VG2_Multi_Multi_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SVE2_VG2_Multi_Multi_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                 [LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMMatchType<0>, LLVMMatchType<0>],
                 [IntrNoMem]>;
 
-  class SVE2_VG2_Multi_Multi_Scale_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SVE2_VG2_Multi_Multi_Scale_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                 [LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>],
                 [IntrNoMem]>;
 
-  class SVE2_VG4_Multi_Multi_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SVE2_VG4_Multi_Multi_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
                              LLVMMatchType<0>,  LLVMMatchType<0>],
                             [LLVMMatchType<0>,  LLVMMatchType<0>,
                              LLVMMatchType<0>,  LLVMMatchType<0>,
@@ -3462,8 +4055,8 @@ let TargetPrefix = "aarch64" in {
                              LLVMMatchType<0>, LLVMMatchType<0>],
                             [IntrNoMem]>;
 
-  class SVE2_VG4_Multi_Multi_Scale_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SVE2_VG4_Multi_Multi_Scale_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
                              LLVMMatchType<0>,  LLVMMatchType<0>],
                             [LLVMMatchType<0>,  LLVMMatchType<0>,
                              LLVMMatchType<0>,  LLVMMatchType<0>,
@@ -3471,14 +4064,14 @@ let TargetPrefix = "aarch64" in {
                              LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>],
                             [IntrNoMem]>;
 
-  class SVE2_VG2_Sel_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SVE2_VG2_Sel_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                 [llvm_aarch64_svcount_ty, LLVMMatchType<0>,
                  LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMMatchType<0>], [IntrNoMem]>;
 
-  class SVE2_VG4_Sel_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SVE2_VG4_Sel_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
                              LLVMMatchType<0>, LLVMMatchType<0>],
                 [llvm_aarch64_svcount_ty, LLVMMatchType<0>,
                  LLVMMatchType<0>, LLVMMatchType<0>,
@@ -3486,124 +4079,123 @@ let TargetPrefix = "aarch64" in {
                  LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMMatchType<0>], [IntrNoMem]>;
 
-  class SVE2_CVT_VG2_SINGLE_Intrinsic
-    : DefaultAttrsIntrinsic<[LLVMSubdivide2VectorType<0>],
+  class Guarded_SVE2_CVT_VG2_SINGLE_Intrinsic
+    : GuardedDefaultIntrinsic<[LLVMSubdivide2VectorType<0>],
                             [llvm_anyvector_ty, LLVMMatchType<0>],
                             [IntrNoMem]>;
 
-  class SVE2_CVT_VG2_SINGLE_BF16_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_nxv8bf16_ty],
+  class Guarded_SVE2_CVT_VG2_SINGLE_BF16_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_nxv8bf16_ty],
                             [llvm_nxv4f32_ty, llvm_nxv4f32_ty],
                             [IntrNoMem]>;
 
-  class SVE2_CVT_WIDENING_VG2_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SVE2_CVT_WIDENING_VG2_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                             [LLVMSubdivide2VectorType<0>], [IntrNoMem]>;
 
-
-  class SVE2_CVT_VG4_SINGLE_Intrinsic
-    : DefaultAttrsIntrinsic<[LLVMSubdivide4VectorType<0>],
+  class Guarded_SVE2_CVT_VG4_SINGLE_Intrinsic
+    : GuardedDefaultIntrinsic<[LLVMSubdivide4VectorType<0>],
                             [llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
                             [IntrNoMem]>;
 
-  class SVE2_CVT_X2_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SVE2_CVT_X2_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                             [llvm_anyvector_ty, LLVMMatchType<1>],
                             [IntrNoMem]>;
 
-  class SVE2_CVT_X4_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
+  class Guarded_SVE2_CVT_X4_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
                             [llvm_anyvector_ty, LLVMMatchType<1>, LLVMMatchType<1>, LLVMMatchType<1>],
                             [IntrNoMem]>;
 
-  class SVE2_BFMLS_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_nxv4f32_ty],
+  class Guarded_SVE2_BFMLS_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_nxv4f32_ty],
                             [llvm_nxv4f32_ty, llvm_nxv8bf16_ty, llvm_nxv8bf16_ty],
                             [IntrNoMem]>;
 
-  class SVE2_BFMLS_Lane_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_nxv4f32_ty],
+  class Guarded_SVE2_BFMLS_Lane_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_nxv4f32_ty],
                             [llvm_nxv4f32_ty, llvm_nxv8bf16_ty, llvm_nxv8bf16_ty, llvm_i32_ty],
                             [IntrNoMem, ImmArg<ArgIndex<3>>]>;
 
-  class SME2_ZA_ArrayVector_Read_VG2_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SME2_ZA_ArrayVector_Read_VG2_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                 [llvm_i32_ty],
                 [IntrRead<[ZA]>, IntrReadOnly]>;
 
-  class SME2_ZA_ArrayVector_Read_VG4_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SME2_ZA_ArrayVector_Read_VG4_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
                              LLVMMatchType<0>,  LLVMMatchType<0>],
                 [llvm_i32_ty],
                 [IntrRead<[ZA]>, IntrReadOnly]>;
 
-  class SME2_Matrix_TileVector_Read_VG2_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SME2_Matrix_TileVector_Read_VG2_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                 [llvm_i32_ty, llvm_i32_ty],
                 [IntrRead<[ZA]>, IntrReadOnly]>;
 
-  class SME2_Matrix_TileVector_Read_VG4_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SME2_Matrix_TileVector_Read_VG4_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
                              LLVMMatchType<0>,  LLVMMatchType<0>],
                 [llvm_i32_ty, llvm_i32_ty],
                 [IntrRead<[ZA]>, IntrReadOnly]>;
 
-  class SME2_ZA_ArrayVector_Write_VG2_Intrinsic
-   : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_ZA_ArrayVector_Write_VG2_Intrinsic
+   : GuardedDefaultIntrinsic<[],
                [llvm_i32_ty,
                 llvm_anyvector_ty, LLVMMatchType<0>],
                [IntrWrite<[ZA]>, IntrWriteOnly]>;
 
-  class SME2_ZA_ArrayVector_Write_VG4_Intrinsic
-   : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_ZA_ArrayVector_Write_VG4_Intrinsic
+   : GuardedDefaultIntrinsic<[],
                [llvm_i32_ty,
                 llvm_anyvector_ty, LLVMMatchType<0>,
                 LLVMMatchType<0>,  LLVMMatchType<0>],
                [IntrWrite<[ZA]>, IntrWriteOnly]>;
 
-  class SME2_Matrix_TileVector_Write_VG2_Intrinsic
-   : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Matrix_TileVector_Write_VG2_Intrinsic
+   : GuardedDefaultIntrinsic<[],
                [llvm_i32_ty, llvm_i32_ty,
                 llvm_anyvector_ty, LLVMMatchType<0>],
                [IntrWrite<[ZA]>, IntrWriteOnly, ImmArg<ArgIndex<0>>]>;
 
-  class SME2_Matrix_TileVector_Write_VG4_Intrinsic
-   : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Matrix_TileVector_Write_VG4_Intrinsic
+   : GuardedDefaultIntrinsic<[],
                [llvm_i32_ty, llvm_i32_ty,
                 llvm_anyvector_ty, LLVMMatchType<0>,
                 LLVMMatchType<0>,  LLVMMatchType<0>],
                [IntrWrite<[ZA]>, IntrWriteOnly, ImmArg<ArgIndex<0>>]>;
 
-  class SVE2_VG2_Multi_Single_Single_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SVE2_VG2_Multi_Single_Single_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                 [LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMMatchType<0>, LLVMMatchType<0>],
                 [IntrNoMem]>;
 
-  class SVE2_VG4_Multi_Single_Single_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SVE2_VG4_Multi_Single_Single_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
                              LLVMMatchType<0>, LLVMMatchType<0>],
                 [LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMMatchType<0>, LLVMMatchType<0>],
                 [IntrNoMem]>;
 
-  class SVE2_VG2_ZipUzp_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SVE2_VG2_ZipUzp_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                 [LLVMMatchType<0>, LLVMMatchType<0>], [IntrNoMem]>;
 
-  class SVE2_VG4_ZipUzp_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SVE2_VG4_ZipUzp_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
                              LLVMMatchType<0>, LLVMMatchType<0>],
                 [LLVMMatchType<0>, LLVMMatchType<0>,
                  LLVMMatchType<0>, LLVMMatchType<0>], [IntrNoMem]>;
 
-  class SVE2_VG2_Unpk_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SVE2_VG2_Unpk_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                 [LLVMSubdivide2VectorType<0>], [IntrNoMem]>;
 
-  class SVE2_VG4_Unpk_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
+  class Guarded_SVE2_VG4_Unpk_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>,
                              LLVMMatchType<0>, LLVMMatchType<0>],
                 [LLVMSubdivide2VectorType<0>, LLVMSubdivide2VectorType<0>],
                 [IntrNoMem]>;
@@ -3612,81 +4204,117 @@ let TargetPrefix = "aarch64" in {
   // Multi-vector fused multiply-add/subtract
   //
 
-  def int_aarch64_sme_fmla_single_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
-  def int_aarch64_sme_fmls_single_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
-  def int_aarch64_sme_fmla_single_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
-  def int_aarch64_sme_fmls_single_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
-
-  def int_aarch64_sme_fmla_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
-  def int_aarch64_sme_fmls_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
-  def int_aarch64_sme_fmla_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
-  def int_aarch64_sme_fmls_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
-
-  def int_aarch64_sme_fmla_lane_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
-  def int_aarch64_sme_fmls_lane_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
-  def int_aarch64_sme_fmla_lane_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
-  def int_aarch64_sme_fmls_lane_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+  let TargetGuards = [
+    StreamingVariant<"sme2,sme-f64f64", F64_Overloads>,
+    StreamingVariant<"sme2", F32_Overloads>,
+    StreamingVariant<"sme-b16b16", BF16_Overloads>,
+    StreamingVariant<"sme-f16f16", F16_Overloads>,
+  ] in {
+    def int_aarch64_sme_fmla_single_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
+    def int_aarch64_sme_fmls_single_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
+    def int_aarch64_sme_fmla_single_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
+    def int_aarch64_sme_fmls_single_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
+
+    def int_aarch64_sme_fmla_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
+    def int_aarch64_sme_fmls_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
+    def int_aarch64_sme_fmla_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+    def int_aarch64_sme_fmls_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+
+    def int_aarch64_sme_fmla_lane_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+    def int_aarch64_sme_fmls_lane_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+    def int_aarch64_sme_fmla_lane_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+    def int_aarch64_sme_fmls_lane_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+  }
 
   //
   // Outer product and accumulate/subtract intrinsics
   //
 
-  def int_aarch64_sme_smopa_za32 : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_umopa_za32 : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_smops_za32 : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_umops_za32 : SME_OuterProduct_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I16_Overloads>] in {
+    def int_aarch64_sme_smopa_za32 : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_umopa_za32 : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_smops_za32 : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_umops_za32 : Guarded_SME_OuterProduct_Intrinsic;
+  }
 
-  def int_aarch64_sme_bmopa_za32 : SME_OuterProduct_Intrinsic;
-  def int_aarch64_sme_bmops_za32 : SME_OuterProduct_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I32_Overloads>] in {
+    def int_aarch64_sme_bmopa_za32 : Guarded_SME_OuterProduct_Intrinsic;
+    def int_aarch64_sme_bmops_za32 : Guarded_SME_OuterProduct_Intrinsic;
+  }
 
   //
   // Multi-vector rounding shift left intrinsics
   //
 
-  def int_aarch64_sve_srshl_single_x2 : SVE2_VG2_Multi_Single_Intrinsic;
-  def int_aarch64_sve_urshl_single_x2 : SVE2_VG2_Multi_Single_Intrinsic;
-  def int_aarch64_sve_srshl_single_x4 : SVE2_VG4_Multi_Single_Intrinsic;
-  def int_aarch64_sve_urshl_single_x4 : SVE2_VG4_Multi_Single_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I8_I16_I32_I64_Overloads>] in {
+    def int_aarch64_sve_srshl_single_x2 : Guarded_SVE2_VG2_Multi_Single_Intrinsic;
+    def int_aarch64_sve_urshl_single_x2 : Guarded_SVE2_VG2_Multi_Single_Intrinsic;
+    def int_aarch64_sve_srshl_single_x4 : Guarded_SVE2_VG4_Multi_Single_Intrinsic;
+    def int_aarch64_sve_urshl_single_x4 : Guarded_SVE2_VG4_Multi_Single_Intrinsic;
 
-  def int_aarch64_sve_srshl_x2 : SVE2_VG2_Multi_Multi_Intrinsic;
-  def int_aarch64_sve_urshl_x2 : SVE2_VG2_Multi_Multi_Intrinsic;
-  def int_aarch64_sve_srshl_x4 : SVE2_VG4_Multi_Multi_Intrinsic;
-  def int_aarch64_sve_urshl_x4 : SVE2_VG4_Multi_Multi_Intrinsic;
+    def int_aarch64_sve_srshl_x2 : Guarded_SVE2_VG2_Multi_Multi_Intrinsic;
+    def int_aarch64_sve_urshl_x2 : Guarded_SVE2_VG2_Multi_Multi_Intrinsic;
+    def int_aarch64_sve_srshl_x4 : Guarded_SVE2_VG4_Multi_Multi_Intrinsic;
+    def int_aarch64_sve_urshl_x4 : Guarded_SVE2_VG4_Multi_Multi_Intrinsic;
+  }
 
   // Multi-vector saturating rounding shift right intrinsics
 
-  def int_aarch64_sve_sqrshr_x2 : SVE2_VG2_Multi_Imm_Intrinsic;
-  def int_aarch64_sve_uqrshr_x2 : SVE2_VG2_Multi_Imm_Intrinsic;
-  def int_aarch64_sve_sqrshr_x4 : SVE2_VG4_Multi_Imm_Intrinsic;
-  def int_aarch64_sve_uqrshr_x4 : SVE2_VG4_Multi_Imm_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I32_Overloads>] in {
+    def int_aarch64_sve_sqrshr_x2 : Guarded_SVE2_VG2_Multi_Imm_Intrinsic;
+    def int_aarch64_sve_uqrshr_x2 : Guarded_SVE2_VG2_Multi_Imm_Intrinsic;
 
-  def int_aarch64_sve_sqrshrn_x2 : SVE2_VG2_Multi_Imm_Intrinsic;
-  def int_aarch64_sve_uqrshrn_x2 : SVE2_VG2_Multi_Imm_Intrinsic;
-  def int_aarch64_sve_sqrshrn_x4 : SVE2_VG4_Multi_Imm_Intrinsic;
-  def int_aarch64_sve_uqrshrn_x4 : SVE2_VG4_Multi_Imm_Intrinsic;
+    def int_aarch64_sve_sqrshru_x2 : Guarded_SVE2_VG2_Multi_Imm_Intrinsic;
+  }
 
-  def int_aarch64_sve_sqrshru_x2 : SVE2_VG2_Multi_Imm_Intrinsic;
-  def int_aarch64_sve_sqrshru_x4 : SVE2_VG4_Multi_Imm_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I32_I64_Overloads>] in {
+    def int_aarch64_sve_sqrshr_x4 : Guarded_SVE2_VG4_Multi_Imm_Intrinsic;
+    def int_aarch64_sve_uqrshr_x4 : Guarded_SVE2_VG4_Multi_Imm_Intrinsic;
+
+    def int_aarch64_sve_sqrshrn_x4 : Guarded_SVE2_VG4_Multi_Imm_Intrinsic;
+    def int_aarch64_sve_uqrshrn_x4 : Guarded_SVE2_VG4_Multi_Imm_Intrinsic;
+
+    def int_aarch64_sve_sqrshru_x4 : Guarded_SVE2_VG4_Multi_Imm_Intrinsic;
+    def int_aarch64_sve_sqrshrun_x4 : Guarded_SVE2_VG4_Multi_Imm_Intrinsic;
+  }
 
-  def int_aarch64_sve_sqrshrun_x2 : SVE2_VG2_Multi_Imm_Intrinsic;
-  def int_aarch64_sve_sqrshrun_x4 : SVE2_VG4_Multi_Imm_Intrinsic;
+  let TargetGuards = [
+    Variant<"sve,(sve2p1|sme2)", "sve2p1|sme2", I32_Overloads>,
+    Variant<"sve,(sve2p3|sme2p3)", "sve2p3|sme2p3", I16_Overloads>,
+  ] in {
+    def int_aarch64_sve_sqrshrn_x2 : Guarded_SVE2_VG2_Multi_Imm_Intrinsic;
+    def int_aarch64_sve_uqrshrn_x2 : Guarded_SVE2_VG2_Multi_Imm_Intrinsic;
+
+    def int_aarch64_sve_sqrshrun_x2 : Guarded_SVE2_VG2_Multi_Imm_Intrinsic;
+  }
 
   //
   // Multi-vector multiply-add/subtract long
   //
 
-  foreach ty = ["f", "s", "u"] in {
-    foreach instr = ["mlal", "mlsl"] in {
-      def int_aarch64_sme_ # ty # instr # _single_vg2x1  : SME2_Matrix_ArrayVector_Single_Single_Intrinsic;
-      def int_aarch64_sme_ # ty # instr # _single_vg2x2  : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
-      def int_aarch64_sme_ # ty # instr # _single_vg2x4  : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
-
-      def int_aarch64_sme_ # ty # instr # _vg2x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
-      def int_aarch64_sme_ # ty # instr # _vg2x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+  foreach op = ["fmlal", "fmlsl"] in {
+    let TargetGuards = [StreamingVariant<"sme2", BF16_F16_Overloads>] in {
+      def int_aarch64_sme_ # op # _single_vg2x1 : Guarded_SME2_Matrix_ArrayVector_Single_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _single_vg2x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _single_vg2x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _vg2x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # op # _vg2x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # op # _lane_vg2x1 : Guarded_SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
+      def int_aarch64_sme_ # op # _lane_vg2x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+      def int_aarch64_sme_ # op # _lane_vg2x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+    }
+  }
 
-      def int_aarch64_sme_ # ty # instr # _lane_vg2x1  : SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
-      def int_aarch64_sme_ # ty # instr # _lane_vg2x2  : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
-      def int_aarch64_sme_ # ty # instr # _lane_vg2x4  : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+  foreach op = ["smlal", "smlsl", "umlal", "umlsl"] in {
+    let TargetGuards = [StreamingVariant<"sme2", I16_Overloads>] in {
+      def int_aarch64_sme_ # op # _single_vg2x1 : Guarded_SME2_Matrix_ArrayVector_Single_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _single_vg2x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _single_vg2x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _vg2x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # op # _vg2x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # op # _lane_vg2x1 : Guarded_SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
+      def int_aarch64_sme_ # op # _lane_vg2x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+      def int_aarch64_sme_ # op # _lane_vg2x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
     }
   }
 
@@ -3694,77 +4322,107 @@ let TargetPrefix = "aarch64" in {
   // Multi-vector multiply-add long long
   //
 
-  foreach ty = ["s", "u"] in {
-    foreach instr = ["mla", "mls"] in {
-      foreach za = ["za32", "za64"] in {
-        def int_aarch64_sme_ # ty # instr # _ # za # _single_vg4x1 : SME2_Matrix_ArrayVector_Single_Single_Intrinsic;
-        def int_aarch64_sme_ # ty # instr # _ # za # _single_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
-        def int_aarch64_sme_ # ty # instr # _ # za # _single_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
-
-        def int_aarch64_sme_ # ty # instr # _ # za # _vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
-        def int_aarch64_sme_ # ty # instr # _ # za # _vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+  foreach op = ["smla", "smls", "umla", "umls"] in {
+    let TargetGuards = [StreamingVariant<"sme2", I8_Overloads>] in {
+      def int_aarch64_sme_ # op # _za32_single_vg4x1 : Guarded_SME2_Matrix_ArrayVector_Single_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _za32_single_vg4x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _za32_single_vg4x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _za32_vg4x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # op # _za32_vg4x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # op # _za32_lane_vg4x1 : Guarded_SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
+      def int_aarch64_sme_ # op # _za32_lane_vg4x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+      def int_aarch64_sme_ # op # _za32_lane_vg4x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+    }
+  }
 
-        def int_aarch64_sme_ # ty # instr # _ # za # _lane_vg4x1 : SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
-        def int_aarch64_sme_ # ty # instr # _ # za # _lane_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
-        def int_aarch64_sme_ # ty # instr # _ # za # _lane_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
-      }
+  foreach op = ["smla", "smls", "umla", "umls"] in {
+    let TargetGuards = [StreamingVariant<"sme2,sme-i16i64", I16_Overloads>] in {
+      def int_aarch64_sme_ # op # _za64_single_vg4x1 : Guarded_SME2_Matrix_ArrayVector_Single_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _za64_single_vg4x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _za64_single_vg4x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _za64_vg4x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # op # _za64_vg4x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # op # _za64_lane_vg4x1 : Guarded_SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
+      def int_aarch64_sme_ # op # _za64_lane_vg4x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+      def int_aarch64_sme_ # op # _za64_lane_vg4x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
     }
   }
 
-  def int_aarch64_sme_sumla_za32_single_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
-  def int_aarch64_sme_sumla_za32_single_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I8_Overloads>] in {
+    def int_aarch64_sme_sumla_za32_single_vg4x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
+    def int_aarch64_sme_sumla_za32_single_vg4x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
 
-  def int_aarch64_sme_sumla_za32_lane_vg4x1 : SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
-  def int_aarch64_sme_sumla_za32_lane_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
-  def int_aarch64_sme_sumla_za32_lane_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+    def int_aarch64_sme_sumla_za32_lane_vg4x1 : Guarded_SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
+    def int_aarch64_sme_sumla_za32_lane_vg4x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+    def int_aarch64_sme_sumla_za32_lane_vg4x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
 
-  def int_aarch64_sme_usmla_za32_single_vg4x1 : SME2_Matrix_ArrayVector_Single_Single_Intrinsic;
-  def int_aarch64_sme_usmla_za32_single_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
-  def int_aarch64_sme_usmla_za32_single_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
+    def int_aarch64_sme_usmla_za32_single_vg4x1 : Guarded_SME2_Matrix_ArrayVector_Single_Single_Intrinsic;
+    def int_aarch64_sme_usmla_za32_single_vg4x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
+    def int_aarch64_sme_usmla_za32_single_vg4x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
 
-  def int_aarch64_sme_usmla_za32_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
-  def int_aarch64_sme_usmla_za32_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+    def int_aarch64_sme_usmla_za32_vg4x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
+    def int_aarch64_sme_usmla_za32_vg4x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
 
-  def int_aarch64_sme_usmla_za32_lane_vg4x1 : SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
-  def int_aarch64_sme_usmla_za32_lane_vg4x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
-  def int_aarch64_sme_usmla_za32_lane_vg4x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+    def int_aarch64_sme_usmla_za32_lane_vg4x1 : Guarded_SME2_Matrix_ArrayVector_Single_Index_Intrinsic;
+    def int_aarch64_sme_usmla_za32_lane_vg4x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+    def int_aarch64_sme_usmla_za32_lane_vg4x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+  }
 
-  def int_aarch64_sve_bfmlslb : SVE2_BFMLS_Intrinsic;
-  def int_aarch64_sve_bfmlslb_lane : SVE2_BFMLS_Lane_Intrinsic;
+  let TargetGuards = [Variant<"sve,(sve2p1|sme2)", "sve2p1|sme2", EmptyOverload>] in {
+    def int_aarch64_sve_bfmlslb : Guarded_SVE2_BFMLS_Intrinsic;
+    def int_aarch64_sve_bfmlslb_lane : Guarded_SVE2_BFMLS_Lane_Intrinsic;
 
-  def int_aarch64_sve_bfmlslt : SVE2_BFMLS_Intrinsic;
-  def int_aarch64_sve_bfmlslt_lane : SVE2_BFMLS_Lane_Intrinsic;
+    def int_aarch64_sve_bfmlslt : Guarded_SVE2_BFMLS_Intrinsic;
+    def int_aarch64_sve_bfmlslt_lane : Guarded_SVE2_BFMLS_Lane_Intrinsic;
+  }
 
   // Multi-vector zeroing
 
   foreach vg = ["vg1x2", "vg1x4", "vg2x1", "vg2x2", "vg2x4", "vg4x1", "vg4x2", "vg4x4"] in {
-    def int_aarch64_sme_zero_za64_ # vg : DefaultAttrsIntrinsic<[], [llvm_i32_ty],  [IntrWrite<[ZA]>, IntrWriteOnly]>;
+    let TargetGuards = [StreamingVariant<"sme2p1", EmptyOverload>] in
+    def int_aarch64_sme_zero_za64_ # vg : GuardedDefaultIntrinsic<[], [llvm_i32_ty],  [IntrWrite<[ZA]>, IntrWriteOnly]>;
   }
   // Multi-vector signed saturating doubling multiply high
-  def int_aarch64_sve_sqdmulh_single_vgx2 : SVE2_VG2_Multi_Single_Intrinsic;
-  def int_aarch64_sve_sqdmulh_single_vgx4 : SVE2_VG4_Multi_Single_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I8_I16_I32_I64_Overloads>] in {
+    def int_aarch64_sve_sqdmulh_single_vgx2 : Guarded_SVE2_VG2_Multi_Single_Intrinsic;
+    def int_aarch64_sve_sqdmulh_single_vgx4 : Guarded_SVE2_VG4_Multi_Single_Intrinsic;
 
-  def int_aarch64_sve_sqdmulh_vgx2 : SVE2_VG2_Multi_Multi_Intrinsic;
-  def int_aarch64_sve_sqdmulh_vgx4 : SVE2_VG4_Multi_Multi_Intrinsic;
+    def int_aarch64_sve_sqdmulh_vgx2 : Guarded_SVE2_VG2_Multi_Multi_Intrinsic;
+    def int_aarch64_sve_sqdmulh_vgx4 : Guarded_SVE2_VG4_Multi_Multi_Intrinsic;
+  }
 
   // Multi-vector floating-point round to integral value
 
   foreach inst = ["a", "m", "n", "p"] in {
-    def int_aarch64_sve_frint # inst # _x2 : SVE2_VG2_ZipUzp_Intrinsic;
-    def int_aarch64_sve_frint # inst # _x4 : SVE2_VG4_ZipUzp_Intrinsic;
+    let TargetGuards = [StreamingVariant<"sme2", F32_Overloads>] in {
+      def int_aarch64_sve_frint # inst # _x2 : Guarded_SVE2_VG2_ZipUzp_Intrinsic;
+      def int_aarch64_sve_frint # inst # _x4 : Guarded_SVE2_VG4_ZipUzp_Intrinsic;
+    }
   }
 
   //
   // Multi-vector min/max
   //
 
-  foreach ty = ["f", "s", "u"] in {
-    foreach instr = ["max", "min"] in {
-      def int_aarch64_sve_ # ty # instr # _single_x2 : SVE2_VG2_Multi_Single_Intrinsic;
-      def int_aarch64_sve_ # ty # instr # _single_x4 : SVE2_VG4_Multi_Single_Intrinsic;
+  foreach op = ["fmax", "fmin"] in {
+    let TargetGuards = [
+      StreamingVariant<"sme2", F32_F64_Overloads>,
+      StreamingVariant<"sme2,sve-b16b16", BF16_Overloads>,
+      StreamingVariant<"sme2", F16_Overloads>,
+    ] in {
+      def int_aarch64_sve_ # op # _single_x2 : Guarded_SVE2_VG2_Multi_Single_Intrinsic;
+      def int_aarch64_sve_ # op # _single_x4 : Guarded_SVE2_VG4_Multi_Single_Intrinsic;
+      def int_aarch64_sve_ # op # _x2 : Guarded_SVE2_VG2_Multi_Multi_Intrinsic;
+      def int_aarch64_sve_ # op # _x4 : Guarded_SVE2_VG4_Multi_Multi_Intrinsic;
+    }
+  }
 
-      def int_aarch64_sve_ # ty # instr # _x2 : SVE2_VG2_Multi_Multi_Intrinsic;
-      def int_aarch64_sve_ # ty # instr # _x4 : SVE2_VG4_Multi_Multi_Intrinsic;
+  foreach op = ["smax", "smin", "umax", "umin"] in {
+    let TargetGuards = [StreamingVariant<"sme2", I8_I16_I32_I64_Overloads>] in {
+      def int_aarch64_sve_ # op # _single_x2 : Guarded_SVE2_VG2_Multi_Single_Intrinsic;
+      def int_aarch64_sve_ # op # _single_x4 : Guarded_SVE2_VG4_Multi_Single_Intrinsic;
+      def int_aarch64_sve_ # op # _x2 : Guarded_SVE2_VG2_Multi_Multi_Intrinsic;
+      def int_aarch64_sve_ # op # _x4 : Guarded_SVE2_VG4_Multi_Multi_Intrinsic;
     }
   }
 
@@ -3772,165 +4430,267 @@ let TargetPrefix = "aarch64" in {
   // Multi-vector floating point min/max number, scale, and multiply
   //
 
-  foreach instr = ["fmaxnm", "fminnm", "fmul"] in {
-    def int_aarch64_sve_ # instr # _single_x2 : SVE2_VG2_Multi_Single_Intrinsic;
-    def int_aarch64_sve_ # instr # _single_x4 : SVE2_VG4_Multi_Single_Intrinsic;
-
-    def int_aarch64_sve_ # instr # _x2 : SVE2_VG2_Multi_Multi_Intrinsic;
-    def int_aarch64_sve_ # instr # _x4 : SVE2_VG4_Multi_Multi_Intrinsic;
+  foreach op = ["fmaxnm", "fminnm"] in {
+    let TargetGuards = [
+      StreamingVariant<"sme2", F32_F64_Overloads>,
+      StreamingVariant<"sme2,sve-b16b16", BF16_Overloads>,
+      StreamingVariant<"sme2", F16_Overloads>,
+    ] in {
+      def int_aarch64_sve_ # op # _single_x2 : Guarded_SVE2_VG2_Multi_Single_Intrinsic;
+      def int_aarch64_sve_ # op # _single_x4 : Guarded_SVE2_VG4_Multi_Single_Intrinsic;
+      def int_aarch64_sve_ # op # _x2 : Guarded_SVE2_VG2_Multi_Multi_Intrinsic;
+      def int_aarch64_sve_ # op # _x4 : Guarded_SVE2_VG4_Multi_Multi_Intrinsic;
+    }
+  }
+  let TargetGuards = [
+    StreamingVariant<"sme2p2", F32_F64_Overloads>,
+    StreamingVariant<"sme2,sve-bfscale", BF16_Overloads>,
+    StreamingVariant<"sme2p2", F16_Overloads>,
+  ] in {
+    def int_aarch64_sve_fmul_single_x2 : Guarded_SVE2_VG2_Multi_Single_Intrinsic;
+    def int_aarch64_sve_fmul_single_x4 : Guarded_SVE2_VG4_Multi_Single_Intrinsic;
+
+    def int_aarch64_sve_fmul_x2 : Guarded_SVE2_VG2_Multi_Multi_Intrinsic;
+    def int_aarch64_sve_fmul_x4 : Guarded_SVE2_VG4_Multi_Multi_Intrinsic;
   }
 
   //
   // Multi-vector floating point scale
   //
 
-  def int_aarch64_sve_fscale_single_x2 : SVE2_VG2_Multi_Single_Scale_Intrinsic;
-  def int_aarch64_sve_fscale_single_x4 : SVE2_VG4_Multi_Single_Scale_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2,sve-bfscale", BF16_Overloads>] in {
+    def int_aarch64_sve_fscale_single_x2 : Guarded_SVE2_VG2_Multi_Single_Scale_Intrinsic;
+    def int_aarch64_sve_fscale_single_x4 : Guarded_SVE2_VG4_Multi_Single_Scale_Intrinsic;
 
-  def int_aarch64_sve_fscale_x2 : SVE2_VG2_Multi_Multi_Scale_Intrinsic;
-  def int_aarch64_sve_fscale_x4 : SVE2_VG4_Multi_Multi_Scale_Intrinsic;
+    def int_aarch64_sve_fscale_x2 : Guarded_SVE2_VG2_Multi_Multi_Scale_Intrinsic;
+    def int_aarch64_sve_fscale_x4 : Guarded_SVE2_VG4_Multi_Multi_Scale_Intrinsic;
+  }
 
   //
   // Multi-vector floating point absolute min/max number
   //
 
   foreach instr = ["famax", "famin"] in {
-    def int_aarch64_sme_ # instr # _x2 : SVE2_VG2_Multi_Multi_Intrinsic;
-    def int_aarch64_sme_ # instr # _x4 : SVE2_VG4_Multi_Multi_Intrinsic;
+    let TargetGuards = [StreamingVariant<"sme2,faminmax", F16_F32_F64_Overloads>] in {
+      def int_aarch64_sme_ # instr # _x2 : Guarded_SVE2_VG2_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # instr # _x4 : Guarded_SVE2_VG4_Multi_Multi_Intrinsic;
+    }
   }
 
   //
   // Multi-vector vertical dot-products
   //
 
-  def int_aarch64_sme_fvdot_lane_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", BF16_F16_Overloads>] in
+  def int_aarch64_sme_fvdot_lane_za32_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
 
-  foreach ty = ["s", "u"] in {
-    def int_aarch64_sme_ #ty # vdot_lane_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
-    def int_aarch64_sme_ #ty # vdot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
-    def int_aarch64_sme_ #ty # vdot_lane_za64_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I16_Overloads>] in {
+    def int_aarch64_sme_svdot_lane_za32_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+    def int_aarch64_sme_uvdot_lane_za32_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
   }
 
-  def int_aarch64_sme_suvdot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
-  def int_aarch64_sme_usvdot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I8_Overloads>] in {
+    def int_aarch64_sme_svdot_lane_za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+    def int_aarch64_sme_uvdot_lane_za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+    def int_aarch64_sme_suvdot_lane_za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+    def int_aarch64_sme_usvdot_lane_za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+  }
 
+  let TargetGuards = [StreamingVariant<"sme2,sme-i16i64", I16_Overloads>] in {
+    def int_aarch64_sme_svdot_lane_za64_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+    def int_aarch64_sme_uvdot_lane_za64_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+  }
 
   //
   //Multi-vector floating-point convert from half-precision to deinterleaved single-precision.
   //
-  def int_aarch64_sve_fcvtl_widen_x2  : SVE2_CVT_WIDENING_VG2_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f16f16", F32_Overloads>] in
+  def int_aarch64_sve_fcvtl_widen_x2  : Guarded_SVE2_CVT_WIDENING_VG2_Intrinsic;
 
   //
   // Multi-vector floating-point CVT from single-precision to interleaved half-precision/BFloat16
   //
-  def int_aarch64_sve_fcvtn_x2  : SVE2_CVT_VG2_SINGLE_Intrinsic;
-  def int_aarch64_sve_bfcvtn_x2 : SVE2_CVT_VG2_SINGLE_BF16_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", F32_Overloads>] in
+  def int_aarch64_sve_fcvtn_x2  : Guarded_SVE2_CVT_VG2_SINGLE_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", EmptyOverload>] in
+  def int_aarch64_sve_bfcvtn_x2 : Guarded_SVE2_CVT_VG2_SINGLE_BF16_Intrinsic;
 
   //
   // Multi-vector convert to/from floating-point.
   //
-  def int_aarch64_sve_fcvt_x2  : SVE2_CVT_VG2_SINGLE_Intrinsic;
-  def int_aarch64_sve_bfcvt_x2 : SVE2_CVT_VG2_SINGLE_BF16_Intrinsic;
-  def int_aarch64_sve_fcvtzs_x2 : SVE2_CVT_X2_Intrinsic;
-  def int_aarch64_sve_fcvtzu_x2 : SVE2_CVT_X2_Intrinsic;
-  def int_aarch64_sve_scvtf_x2  : SVE2_CVT_X2_Intrinsic;
-  def int_aarch64_sve_ucvtf_x2  : SVE2_CVT_X2_Intrinsic;
-  def int_aarch64_sve_fcvtzs_x4 : SVE2_CVT_X4_Intrinsic;
-  def int_aarch64_sve_fcvtzu_x4 : SVE2_CVT_X4_Intrinsic;
-  def int_aarch64_sve_scvtf_x4  : SVE2_CVT_X4_Intrinsic;
-  def int_aarch64_sve_ucvtf_x4  : SVE2_CVT_X4_Intrinsic;
-  def int_aarch64_sve_fcvt_widen_x2 : SVE2_CVT_WIDENING_VG2_Intrinsic;
+
+  let TargetGuards = [StreamingVariant<"sme2", F32_Overloads>] in
+  def int_aarch64_sve_fcvt_x2  : Guarded_SVE2_CVT_VG2_SINGLE_Intrinsic;
+
+  let TargetGuards = [StreamingVariant<"sme2", EmptyOverload>] in
+  def int_aarch64_sve_bfcvt_x2 : Guarded_SVE2_CVT_VG2_SINGLE_BF16_Intrinsic;
+
+  let TargetGuards = [StreamingVariant<"sme2", [[llvm_nxv4i32_ty, LLVMType<nxv4f32>]]>] in {
+    def int_aarch64_sve_fcvtzs_x2 : Guarded_SVE2_CVT_X2_Intrinsic;
+    def int_aarch64_sve_fcvtzu_x2 : Guarded_SVE2_CVT_X2_Intrinsic;
+  }
+
+  let TargetGuards = [StreamingVariant<"sme2", [[llvm_nxv4f32_ty, LLVMType<nxv4i32>]]>] in {
+    def int_aarch64_sve_scvtf_x2  : Guarded_SVE2_CVT_X2_Intrinsic;
+    def int_aarch64_sve_ucvtf_x2  : Guarded_SVE2_CVT_X2_Intrinsic;
+  }
+
+  let TargetGuards = [StreamingVariant<"sme2", [[llvm_nxv4i32_ty, LLVMType<nxv4f32>]]>] in {
+    def int_aarch64_sve_fcvtzs_x4 : Guarded_SVE2_CVT_X4_Intrinsic;
+    def int_aarch64_sve_fcvtzu_x4 : Guarded_SVE2_CVT_X4_Intrinsic;
+  }
+
+  let TargetGuards = [StreamingVariant<"sme2", [[llvm_nxv4f32_ty, LLVMType<nxv4i32>]]>] in {
+    def int_aarch64_sve_scvtf_x4  : Guarded_SVE2_CVT_X4_Intrinsic;
+    def int_aarch64_sve_ucvtf_x4  : Guarded_SVE2_CVT_X4_Intrinsic;
+  }
+
+  let TargetGuards = [StreamingVariant<"sme-f16f16", F32_Overloads>] in
+  def int_aarch64_sve_fcvt_widen_x2 : Guarded_SVE2_CVT_WIDENING_VG2_Intrinsic;
+
   //
   // Multi-vector saturating extract narrow
   //
-  def int_aarch64_sve_sqcvt_x2  : SVE2_CVT_VG2_SINGLE_Intrinsic;
-  def int_aarch64_sve_uqcvt_x2  : SVE2_CVT_VG2_SINGLE_Intrinsic;
-  def int_aarch64_sve_sqcvtu_x2 : SVE2_CVT_VG2_SINGLE_Intrinsic;
-  def int_aarch64_sve_sqcvt_x4  : SVE2_CVT_VG4_SINGLE_Intrinsic;
-  def int_aarch64_sve_uqcvt_x4  : SVE2_CVT_VG4_SINGLE_Intrinsic;
-  def int_aarch64_sve_sqcvtu_x4 : SVE2_CVT_VG4_SINGLE_Intrinsic;
+
+  let TargetGuards = [StreamingVariant<"sme2", I32_Overloads>] in {
+    def int_aarch64_sve_sqcvt_x2  : Guarded_SVE2_CVT_VG2_SINGLE_Intrinsic;
+    def int_aarch64_sve_uqcvt_x2  : Guarded_SVE2_CVT_VG2_SINGLE_Intrinsic;
+    def int_aarch64_sve_sqcvtu_x2 : Guarded_SVE2_CVT_VG2_SINGLE_Intrinsic;
+  }
+
+  let TargetGuards = [StreamingVariant<"sme2", I32_I64_Overloads>] in {
+    def int_aarch64_sve_sqcvt_x4  : Guarded_SVE2_CVT_VG4_SINGLE_Intrinsic;
+    def int_aarch64_sve_uqcvt_x4  : Guarded_SVE2_CVT_VG4_SINGLE_Intrinsic;
+    def int_aarch64_sve_sqcvtu_x4 : Guarded_SVE2_CVT_VG4_SINGLE_Intrinsic;
+  }
 
   //
   // Multi-vector saturating extract narrow and interleave
   //
-  def int_aarch64_sve_sqcvtn_x2  : SVE2_CVT_VG2_SINGLE_Intrinsic;
-  def int_aarch64_sve_uqcvtn_x2  : SVE2_CVT_VG2_SINGLE_Intrinsic;
-  def int_aarch64_sve_sqcvtun_x2 : SVE2_CVT_VG2_SINGLE_Intrinsic;
-  def int_aarch64_sve_sqcvtn_x4  : SVE2_CVT_VG4_SINGLE_Intrinsic;
-  def int_aarch64_sve_uqcvtn_x4  : SVE2_CVT_VG4_SINGLE_Intrinsic;
-  def int_aarch64_sve_sqcvtun_x4 : SVE2_CVT_VG4_SINGLE_Intrinsic;
+  let TargetGuards = [Variant<"sve,(sve2p1|sme2)", "sve2p1|sme2", I32_Overloads>] in {
+    def int_aarch64_sve_sqcvtn_x2  : Guarded_SVE2_CVT_VG2_SINGLE_Intrinsic;
+    def int_aarch64_sve_uqcvtn_x2  : Guarded_SVE2_CVT_VG2_SINGLE_Intrinsic;
+    def int_aarch64_sve_sqcvtun_x2 : Guarded_SVE2_CVT_VG2_SINGLE_Intrinsic;
+  }
+  let TargetGuards = [StreamingVariant<"sme2", I32_I64_Overloads>] in {
+    def int_aarch64_sve_sqcvtn_x4  : Guarded_SVE2_CVT_VG4_SINGLE_Intrinsic;
+    def int_aarch64_sve_uqcvtn_x4  : Guarded_SVE2_CVT_VG4_SINGLE_Intrinsic;
+    def int_aarch64_sve_sqcvtun_x4 : Guarded_SVE2_CVT_VG4_SINGLE_Intrinsic;
+  }
 
   //
   // Multi-vector saturating shift right narrow and interleave
   //
-  def int_aarch64_sve_sqshrn_x2 : SVE2_VG2_Multi_Imm_Intrinsic;
-  def int_aarch64_sve_uqshrn_x2 : SVE2_VG2_Multi_Imm_Intrinsic;
-  def int_aarch64_sve_sqshrun_x2 : SVE2_VG2_Multi_Imm_Intrinsic;
+  let TargetGuards = [
+    Variant<"sve,(sve2p3|sme2p3)", "sve2p3|sme2p3", [[LLVMType<nxv4i32>], [LLVMType<nxv8i16>]]>,
+  ] in {
+    def int_aarch64_sve_sqshrn_x2 : Guarded_SVE2_VG2_Multi_Imm_Intrinsic;
+    def int_aarch64_sve_uqshrn_x2 : Guarded_SVE2_VG2_Multi_Imm_Intrinsic;
+    def int_aarch64_sve_sqshrun_x2 : Guarded_SVE2_VG2_Multi_Imm_Intrinsic;
+  }
 
   //
   // Multi-Single add/sub
   //
 
-  class SME2_Add_Sub_Write_VG2_Multi_Single_Intrinsic
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Add_Sub_Write_VG2_Multi_Single_Intrinsic
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
           llvm_anyvector_ty, LLVMMatchType<0>,
           LLVMMatchType<0>],
           [IntrWrite<[ZA]>, IntrWriteOnly]>;
 
-  class SME2_Add_Sub_Write_VG4_Multi_Single_Intrinsic
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Add_Sub_Write_VG4_Multi_Single_Intrinsic
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
           llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>,
           LLVMMatchType<0>],
         [IntrWrite<[ZA]>, IntrWriteOnly]>;
 
-  def int_aarch64_sme_add_write_single_za_vg1x2 : SME2_Add_Sub_Write_VG2_Multi_Single_Intrinsic;
-  def int_aarch64_sme_sub_write_single_za_vg1x2 : SME2_Add_Sub_Write_VG2_Multi_Single_Intrinsic;
-  def int_aarch64_sme_add_write_single_za_vg1x4 : SME2_Add_Sub_Write_VG4_Multi_Single_Intrinsic;
-  def int_aarch64_sme_sub_write_single_za_vg1x4 : SME2_Add_Sub_Write_VG4_Multi_Single_Intrinsic;
+  let TargetGuards = [
+    StreamingVariant<"sme2,sme-i16i64", I64_Overloads>,
+    StreamingVariant<"sme2", I32_Overloads>,
+  ] in {
+    def int_aarch64_sme_add_write_single_za_vg1x2 : Guarded_SME2_Add_Sub_Write_VG2_Multi_Single_Intrinsic;
+    def int_aarch64_sme_sub_write_single_za_vg1x2 : Guarded_SME2_Add_Sub_Write_VG2_Multi_Single_Intrinsic;
+    def int_aarch64_sme_add_write_single_za_vg1x4 : Guarded_SME2_Add_Sub_Write_VG4_Multi_Single_Intrinsic;
+    def int_aarch64_sme_sub_write_single_za_vg1x4 : Guarded_SME2_Add_Sub_Write_VG4_Multi_Single_Intrinsic;
+  }
 
   //
   // Multi-Multi add/sub
   //
-  class SME2_Add_Sub_Write_VG2_Multi_Multi_Intrinsic
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Add_Sub_Write_VG2_Multi_Multi_Intrinsic
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
           llvm_anyvector_ty, LLVMMatchType<0>,
           LLVMMatchType<0>, LLVMMatchType<0>],
           [IntrWrite<[ZA]>, IntrWriteOnly]>;
 
-  class SME2_Add_Sub_Write_VG4_Multi_Multi_Intrinsic
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_SME2_Add_Sub_Write_VG4_Multi_Multi_Intrinsic
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
           llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>,
           LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>,
           LLVMMatchType<0>, LLVMMatchType<0>],
           [IntrWrite<[ZA]>, IntrWriteOnly]>;
 
-  def int_aarch64_sme_add_write_za_vg1x2 : SME2_Add_Sub_Write_VG2_Multi_Multi_Intrinsic;
-  def int_aarch64_sme_sub_write_za_vg1x2 : SME2_Add_Sub_Write_VG2_Multi_Multi_Intrinsic;
-  def int_aarch64_sme_add_write_za_vg1x4 : SME2_Add_Sub_Write_VG4_Multi_Multi_Intrinsic;
-  def int_aarch64_sme_sub_write_za_vg1x4 : SME2_Add_Sub_Write_VG4_Multi_Multi_Intrinsic;
+  let TargetGuards = [
+    StreamingVariant<"sme2,sme-i16i64", I64_Overloads>,
+    StreamingVariant<"sme2", I32_Overloads>,
+  ] in {
+    def int_aarch64_sme_add_write_za_vg1x2 : Guarded_SME2_Add_Sub_Write_VG2_Multi_Multi_Intrinsic;
+    def int_aarch64_sme_sub_write_za_vg1x2 : Guarded_SME2_Add_Sub_Write_VG2_Multi_Multi_Intrinsic;
+    def int_aarch64_sme_add_write_za_vg1x4 : Guarded_SME2_Add_Sub_Write_VG4_Multi_Multi_Intrinsic;
+    def int_aarch64_sme_sub_write_za_vg1x4 : Guarded_SME2_Add_Sub_Write_VG4_Multi_Multi_Intrinsic;
+  }
 
   // Multi-vector clamps
-  def int_aarch64_sve_sclamp_single_x2 : SVE2_VG2_Multi_Single_Single_Intrinsic;
-  def int_aarch64_sve_uclamp_single_x2 : SVE2_VG2_Multi_Single_Single_Intrinsic;
-  def int_aarch64_sve_fclamp_single_x2 : SVE2_VG2_Multi_Single_Single_Intrinsic;
-  def int_aarch64_sve_bfclamp_single_x2 : SVE2_VG2_Multi_Single_Single_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I8_I16_I32_I64_Overloads>] in {
+    def int_aarch64_sve_sclamp_single_x2 : Guarded_SVE2_VG2_Multi_Single_Single_Intrinsic;
+    def int_aarch64_sve_uclamp_single_x2 : Guarded_SVE2_VG2_Multi_Single_Single_Intrinsic;
+
+    def int_aarch64_sve_sclamp_single_x4 : Guarded_SVE2_VG4_Multi_Single_Single_Intrinsic;
+    def int_aarch64_sve_uclamp_single_x4 : Guarded_SVE2_VG4_Multi_Single_Single_Intrinsic;
+  }
 
-  def int_aarch64_sve_sclamp_single_x4 : SVE2_VG4_Multi_Single_Single_Intrinsic;
-  def int_aarch64_sve_uclamp_single_x4 : SVE2_VG4_Multi_Single_Single_Intrinsic;
-  def int_aarch64_sve_fclamp_single_x4 : SVE2_VG4_Multi_Single_Single_Intrinsic;
-  def int_aarch64_sve_bfclamp_single_x4 : SVE2_VG4_Multi_Single_Single_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", F16_F32_F64_Overloads>] in {
+    def int_aarch64_sve_fclamp_single_x2 : Guarded_SVE2_VG2_Multi_Single_Single_Intrinsic;
+    def int_aarch64_sve_fclamp_single_x4 : Guarded_SVE2_VG4_Multi_Single_Single_Intrinsic;
+  }
+
+  let TargetGuards = [StreamingVariant<"sme2,sve-b16b16", BF16_Overloads>] in {
+    def int_aarch64_sve_bfclamp_single_x2 : Guarded_SVE2_VG2_Multi_Single_Single_Intrinsic;
+    def int_aarch64_sve_bfclamp_single_x4 : Guarded_SVE2_VG4_Multi_Single_Single_Intrinsic;
+  }
 
   //
   // Multi-vector add/sub and accumulate into ZA
   //
-  foreach intr = ["add", "sub"] in {
-    foreach za = ["za16","za32", "za64"] in {
-      def int_aarch64_sme_ # intr # _ # za # _vg1x2 : SME2_ZA_Write_VG2_Intrinsic;
-      def int_aarch64_sme_ # intr # _ # za # _vg1x4 : SME2_ZA_Write_VG4_Intrinsic;
+  foreach op = ["add", "sub"] in {
+    let TargetGuards = [
+      StreamingVariant<"sme-b16b16", BF16_Overloads>,
+      StreamingVariant<"sme-f16f16|sme-f8f16", F16_Overloads>,
+    ] in {
+      def int_aarch64_sme_ # op # _za16_vg1x2 : Guarded_SME2_ZA_Write_VG2_Intrinsic;
+      def int_aarch64_sme_ # op # _za16_vg1x4 : Guarded_SME2_ZA_Write_VG4_Intrinsic;
+    }
+  }
+
+  foreach op = ["add", "sub"] in {
+    let TargetGuards = [StreamingVariant<"sme2", [[llvm_nxv4f32_ty], [llvm_nxv4i32_ty]]>] in {
+      def int_aarch64_sme_ # op # _za32_vg1x2 : Guarded_SME2_ZA_Write_VG2_Intrinsic;
+      def int_aarch64_sme_ # op # _za32_vg1x4 : Guarded_SME2_ZA_Write_VG4_Intrinsic;
+    }
+  }
+
+  foreach op = ["add", "sub"] in {
+    let TargetGuards = [
+      StreamingVariant<"sme2,sme-f64f64", F64_Overloads>,
+      StreamingVariant<"sme2,sme-i16i64", I64_Overloads>,
+    ] in {
+      def int_aarch64_sme_ # op # _za64_vg1x2 : Guarded_SME2_ZA_Write_VG2_Intrinsic;
+      def int_aarch64_sme_ # op # _za64_vg1x4 : Guarded_SME2_ZA_Write_VG4_Intrinsic;
     }
   }
 
@@ -3938,228 +4698,308 @@ let TargetPrefix = "aarch64" in {
   // Move multi-vectors to/from ZA
   //
 
-  def int_aarch64_sme_read_hor_vg2   : SME2_Matrix_TileVector_Read_VG2_Intrinsic;
-  def int_aarch64_sme_read_hor_vg4   : SME2_Matrix_TileVector_Read_VG4_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", AllPackedData_Overloads>] in {
+    def int_aarch64_sme_read_hor_vg2   : Guarded_SME2_Matrix_TileVector_Read_VG2_Intrinsic;
+    def int_aarch64_sme_read_hor_vg4   : Guarded_SME2_Matrix_TileVector_Read_VG4_Intrinsic;
 
-  def int_aarch64_sme_read_ver_vg2   : SME2_Matrix_TileVector_Read_VG2_Intrinsic;
-  def int_aarch64_sme_read_ver_vg4   : SME2_Matrix_TileVector_Read_VG4_Intrinsic;
+    def int_aarch64_sme_read_ver_vg2   : Guarded_SME2_Matrix_TileVector_Read_VG2_Intrinsic;
+    def int_aarch64_sme_read_ver_vg4   : Guarded_SME2_Matrix_TileVector_Read_VG4_Intrinsic;
 
-  def int_aarch64_sme_read_vg1x2 : SME2_ZA_ArrayVector_Read_VG2_Intrinsic;
-  def int_aarch64_sme_read_vg1x4 : SME2_ZA_ArrayVector_Read_VG4_Intrinsic;
+    def int_aarch64_sme_read_vg1x2 : Guarded_SME2_ZA_ArrayVector_Read_VG2_Intrinsic;
+    def int_aarch64_sme_read_vg1x4 : Guarded_SME2_ZA_ArrayVector_Read_VG4_Intrinsic;
 
-  def int_aarch64_sme_write_hor_vg2 : SME2_Matrix_TileVector_Write_VG2_Intrinsic;
-  def int_aarch64_sme_write_hor_vg4 : SME2_Matrix_TileVector_Write_VG4_Intrinsic;
+    def int_aarch64_sme_write_hor_vg2 : Guarded_SME2_Matrix_TileVector_Write_VG2_Intrinsic;
+    def int_aarch64_sme_write_hor_vg4 : Guarded_SME2_Matrix_TileVector_Write_VG4_Intrinsic;
 
-  def int_aarch64_sme_write_ver_vg2 : SME2_Matrix_TileVector_Write_VG2_Intrinsic;
-  def int_aarch64_sme_write_ver_vg4 : SME2_Matrix_TileVector_Write_VG4_Intrinsic;
+    def int_aarch64_sme_write_ver_vg2 : Guarded_SME2_Matrix_TileVector_Write_VG2_Intrinsic;
+    def int_aarch64_sme_write_ver_vg4 : Guarded_SME2_Matrix_TileVector_Write_VG4_Intrinsic;
 
-  def int_aarch64_sme_write_vg1x2 : SME2_ZA_ArrayVector_Write_VG2_Intrinsic;
-  def int_aarch64_sme_write_vg1x4 : SME2_ZA_ArrayVector_Write_VG4_Intrinsic;
+    def int_aarch64_sme_write_vg1x2 : Guarded_SME2_ZA_ArrayVector_Write_VG2_Intrinsic;
+    def int_aarch64_sme_write_vg1x4 : Guarded_SME2_ZA_ArrayVector_Write_VG4_Intrinsic;
+  }
 
   //
   // Multi-Single Vector add
   //
-  def int_aarch64_sve_add_single_x2 : SVE2_VG2_Multi_Single_Intrinsic;
-  def int_aarch64_sve_add_single_x4 : SVE2_VG4_Multi_Single_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I8_I16_I32_I64_Overloads>] in {
+    def int_aarch64_sve_add_single_x2 : Guarded_SVE2_VG2_Multi_Single_Intrinsic;
+    def int_aarch64_sve_add_single_x4 : Guarded_SVE2_VG4_Multi_Single_Intrinsic;
+  }
 
   // 2-way and 4-way multi-vector signed/unsigned integer dot-product
-  foreach ty = ["s", "u"] in {
-    foreach sz = ["za32", "za64"] in {
-      def int_aarch64_sme_ # ty # dot_single_ # sz # _vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
-      def int_aarch64_sme_ # ty # dot_single_ # sz # _vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
-
-      def int_aarch64_sme_ # ty # dot_ # sz # _vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
-      def int_aarch64_sme_ # ty # dot_ # sz # _vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+  foreach op = ["sdot", "udot"] in {
+    let TargetGuards = [StreamingVariant<"sme2", I8_I16_Overloads>] in {
+      def int_aarch64_sme_ # op # _single_za32_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _single_za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _za32_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # op # _za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # op # _lane_za32_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+      def int_aarch64_sme_ # op # _lane_za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+    }
+  }
 
-      def int_aarch64_sme_ # ty # dot_lane_ # sz # _vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
-      def int_aarch64_sme_ # ty # dot_lane_ # sz # _vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+  foreach op = ["sdot", "udot"] in {
+    let TargetGuards = [StreamingVariant<"sme2,sme-i16i64", I16_Overloads>] in {
+      def int_aarch64_sme_ # op # _single_za64_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _single_za64_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # op # _za64_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # op # _za64_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+      def int_aarch64_sme_ # op # _lane_za64_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+      def int_aarch64_sme_ # op # _lane_za64_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
     }
   }
 
   foreach ty = ["su", "us"] in {
-    def int_aarch64_sme_ # ty # dot_single_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
-    def int_aarch64_sme_ # ty # dot_single_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
+    let TargetGuards = [StreamingVariant<"sme2", I8_Overloads>] in {
+      def int_aarch64_sme_ # ty # dot_single_za32_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
+      def int_aarch64_sme_ # ty # dot_single_za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
 
-    def int_aarch64_sme_ # ty # dot_lane_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
-    def int_aarch64_sme_ # ty # dot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+      def int_aarch64_sme_ # ty # dot_lane_za32_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+      def int_aarch64_sme_ # ty # dot_lane_za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+    }
   }
 
-  def int_aarch64_sme_usdot_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
-  def int_aarch64_sme_usdot_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I8_Overloads>] in {
+    def int_aarch64_sme_usdot_za32_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
+    def int_aarch64_sme_usdot_za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+  }
 
   // Multi-vector half-precision or bfloat floating-point dot-product
-  def int_aarch64_sme_fdot_single_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
-  def int_aarch64_sme_fdot_single_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", BF16_F16_Overloads>] in {
+    def int_aarch64_sme_fdot_single_za32_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Single_Intrinsic;
+    def int_aarch64_sme_fdot_single_za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Single_Intrinsic;
 
-  def int_aarch64_sme_fdot_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
-  def int_aarch64_sme_fdot_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
+    def int_aarch64_sme_fdot_za32_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Multi_Intrinsic;
+    def int_aarch64_sme_fdot_za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Multi_Intrinsic;
 
-  def int_aarch64_sme_fdot_lane_za32_vg1x2 : SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
-  def int_aarch64_sme_fdot_lane_za32_vg1x4 : SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+    def int_aarch64_sme_fdot_lane_za32_vg1x2 : Guarded_SME2_Matrix_ArrayVector_VG2_Multi_Index_Intrinsic;
+    def int_aarch64_sme_fdot_lane_za32_vg1x4 : Guarded_SME2_Matrix_ArrayVector_VG4_Multi_Index_Intrinsic;
+  }
 
   // Multi-vector zip and unzips
-  def int_aarch64_sve_zip_x2  : SVE2_VG2_ZipUzp_Intrinsic;
-  def int_aarch64_sve_zipq_x2 : SVE2_VG2_ZipUzp_Intrinsic;
-  def int_aarch64_sve_zip_x4  : SVE2_VG4_ZipUzp_Intrinsic;
-  def int_aarch64_sve_zipq_x4 : SVE2_VG4_ZipUzp_Intrinsic;
-  def int_aarch64_sve_uzp_x2  : SVE2_VG2_ZipUzp_Intrinsic;
-  def int_aarch64_sve_uzpq_x2 : SVE2_VG2_ZipUzp_Intrinsic;
-  def int_aarch64_sve_uzp_x4  : SVE2_VG4_ZipUzp_Intrinsic;
-  def int_aarch64_sve_uzpq_x4 : SVE2_VG4_ZipUzp_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", AllPackedData_Overloads>] in {
+    def int_aarch64_sve_zip_x2  : Guarded_SVE2_VG2_ZipUzp_Intrinsic;
+    def int_aarch64_sve_zipq_x2 : Guarded_SVE2_VG2_ZipUzp_Intrinsic;
+    def int_aarch64_sve_zip_x4  : Guarded_SVE2_VG4_ZipUzp_Intrinsic;
+    def int_aarch64_sve_zipq_x4 : Guarded_SVE2_VG4_ZipUzp_Intrinsic;
+    def int_aarch64_sve_uzp_x2  : Guarded_SVE2_VG2_ZipUzp_Intrinsic;
+    def int_aarch64_sve_uzpq_x2 : Guarded_SVE2_VG2_ZipUzp_Intrinsic;
+    def int_aarch64_sve_uzp_x4  : Guarded_SVE2_VG4_ZipUzp_Intrinsic;
+    def int_aarch64_sve_uzpq_x4 : Guarded_SVE2_VG4_ZipUzp_Intrinsic;
+  }
 
   // Vector dot-products (2-way)
-  def int_aarch64_sve_sdot_x2 : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-  def int_aarch64_sve_udot_x2 : SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
-  def int_aarch64_sve_fdot_x2 : SVE2_3VectorArg_Long_Intrinsic;
-  def int_aarch64_sve_sdot_lane_x2 : SVE2_3VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
-  def int_aarch64_sve_udot_lane_x2 : SVE2_3VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
-  def int_aarch64_sve_fdot_lane_x2 : SVE2_3VectorArgIndexed_Long_Intrinsic;
+  let TargetGuards = [
+    Variant<"sve,(sve2p1|sme2)", "sve2p1|sme2", I32_Overloads>,
+    Variant<"sve,(sve2p3|sme2p3)", "sve2p3|sme2p3", I16_Overloads>,
+  ] in {
+    def int_aarch64_sve_sdot_x2 : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+    def int_aarch64_sve_udot_x2 : Guarded_SVE2_3VectorArg_Long_Intrinsic<[IntrSpeculatable]>;
+
+    def int_aarch64_sve_sdot_lane_x2 : Guarded_SVE2_3VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
+    def int_aarch64_sve_udot_lane_x2 : Guarded_SVE2_3VectorArgIndexed_Long_Intrinsic<[IntrSpeculatable]>;
+  }
+
+  let TargetGuards = [Variant<"sve,(sve2p1|sme2)", "sve2p1|sme2", F32_Overloads>] in {
+    def int_aarch64_sve_fdot_x2 : Guarded_SVE2_3VectorArg_Long_Intrinsic;
+    def int_aarch64_sve_fdot_lane_x2 : Guarded_SVE2_3VectorArgIndexed_Long_Intrinsic;
+  }
 
   //
   // Signed/unsigned multi-vector unpacks
   //
-  def int_aarch64_sve_sunpk_x2 : SVE2_VG2_Unpk_Intrinsic;
-  def int_aarch64_sve_uunpk_x2 : SVE2_VG2_Unpk_Intrinsic;
-  def int_aarch64_sve_sunpk_x4 : SVE2_VG4_Unpk_Intrinsic;
-  def int_aarch64_sve_uunpk_x4 : SVE2_VG4_Unpk_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2", I16_I32_I64_Overloads>] in {
+    def int_aarch64_sve_sunpk_x2 : Guarded_SVE2_VG2_Unpk_Intrinsic;
+    def int_aarch64_sve_uunpk_x2 : Guarded_SVE2_VG2_Unpk_Intrinsic;
+    def int_aarch64_sve_sunpk_x4 : Guarded_SVE2_VG4_Unpk_Intrinsic;
+    def int_aarch64_sve_uunpk_x4 : Guarded_SVE2_VG4_Unpk_Intrinsic;
+  }
 
   // 2-way and 4-way vector selects
-  def int_aarch64_sve_sel_x2  : SVE2_VG2_Sel_Intrinsic;
-  def int_aarch64_sve_sel_x4  : SVE2_VG4_Sel_Intrinsic;
-
+  let TargetGuards = [StreamingVariant<"sme2", AllPackedData_Overloads>] in {
+    def int_aarch64_sve_sel_x2  : Guarded_SVE2_VG2_Sel_Intrinsic;
+    def int_aarch64_sve_sel_x4  : Guarded_SVE2_VG4_Sel_Intrinsic;
+  }
 
-  def int_aarch64_sme_ldr_zt
-    : DefaultAttrsIntrinsic<[], [llvm_i32_ty, llvm_anyptr_ty],
+  let TargetGuards = [Variant<"sme2", "sme2", PTR_Overloads>] in {
+    def int_aarch64_sme_ldr_zt
+    : GuardedDefaultIntrinsic<[], [llvm_i32_ty, llvm_anyptr_ty],
                             [IntrRead<[ArgMem, ZT0]>, IntrWrite<[ZT0]>]>;
-  def int_aarch64_sme_str_zt
-    : DefaultAttrsIntrinsic<[], [llvm_i32_ty, llvm_anyptr_ty],
+    def int_aarch64_sme_str_zt
+    : GuardedDefaultIntrinsic<[], [llvm_i32_ty, llvm_anyptr_ty],
                             [IntrRead<[ZT0]>, IntrWrite<[ArgMem, ZT0]>]>;
+  }
 
   //
   //  Zero ZT0
   //
-  def int_aarch64_sme_zero_zt : DefaultAttrsIntrinsic<[], [llvm_i32_ty], [ImmArg<ArgIndex<0>>, IntrWrite<[ZT0]>, IntrWriteOnly]>;
+  let TargetGuards = [Variant<"sme2", "sme2", EmptyOverload>] in
+  def int_aarch64_sme_zero_zt : GuardedDefaultIntrinsic<[], [llvm_i32_ty], [ImmArg<ArgIndex<0>>, IntrWrite<[ZT0]>, IntrWriteOnly]>;
+
+  defvar SmeLuti2LaneZtTypes = [
+    [llvm_nxv16i8_ty],
+    [llvm_nxv4f32_ty],
+    [llvm_nxv4i32_ty],
+    [llvm_nxv8bf16_ty],
+    [llvm_nxv8f16_ty],
+    [llvm_nxv8i16_ty],
+  ];
+
+  defvar SmeLuti4LaneZtX4Types = [
+    [llvm_nxv4f32_ty],
+    [llvm_nxv4i32_ty],
+    [llvm_nxv8bf16_ty],
+    [llvm_nxv8f16_ty],
+    [llvm_nxv8i16_ty],
+  ];
 
   //
   // Lookup table expand one register
   //
-  def int_aarch64_sme_luti2_lane_zt
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [llvm_i32_ty, llvm_nxv16i8_ty, llvm_i32_ty],
+  let TargetGuards = [StreamingVariant<"sme2", SmeLuti2LaneZtTypes>] in {
+    def int_aarch64_sme_luti2_lane_zt
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty], [llvm_i32_ty, llvm_nxv16i8_ty, llvm_i32_ty],
                             [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<2>>, IntrRead<[ZT0]>, IntrReadOnly]>;
-  def int_aarch64_sme_luti4_lane_zt
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty], [llvm_i32_ty, llvm_nxv16i8_ty, llvm_i32_ty],
+    def int_aarch64_sme_luti4_lane_zt
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty], [llvm_i32_ty, llvm_nxv16i8_ty, llvm_i32_ty],
                             [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<2>>, IntrRead<[ZT0]>, IntrReadOnly]>;
+  }
+
+  let TargetGuards = [StreamingVariant<"sme2p3", EmptyOverload>] in
   def int_aarch64_sme_luti6_zt
-    : DefaultAttrsIntrinsic<[llvm_nxv16i8_ty], [llvm_i32_ty, llvm_nxv16i8_ty],
+    : GuardedDefaultIntrinsic<[llvm_nxv16i8_ty], [llvm_i32_ty, llvm_nxv16i8_ty],
                             [ImmArg<ArgIndex<0>>, IntrRead<[ZT0]>, IntrReadOnly]>;
 
   // Lookup table expand two registers
   //
-  def int_aarch64_sme_luti2_lane_zt_x2
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>], [llvm_i32_ty, llvm_nxv16i8_ty, llvm_i32_ty],
+  let TargetGuards = [StreamingVariant<"sme2", SmeLuti2LaneZtTypes>] in {
+    def int_aarch64_sme_luti2_lane_zt_x2
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>], [llvm_i32_ty, llvm_nxv16i8_ty, llvm_i32_ty],
                             [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<2>>, IntrRead<[ZT0]>, IntrReadOnly]>;
-  def int_aarch64_sme_luti4_lane_zt_x2
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>], [llvm_i32_ty, llvm_nxv16i8_ty, llvm_i32_ty],
+    def int_aarch64_sme_luti4_lane_zt_x2
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>], [llvm_i32_ty, llvm_nxv16i8_ty, llvm_i32_ty],
                             [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<2>>, IntrRead<[ZT0]>, IntrReadOnly]>;
+  }
 
   //
   // Lookup table expand four registers
   //
+  let TargetGuards = [StreamingVariant<"sme2", SmeLuti2LaneZtTypes>] in
   def int_aarch64_sme_luti2_lane_zt_x4
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
                             [llvm_i32_ty, llvm_nxv16i8_ty, llvm_i32_ty],
                             [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<2>>, IntrRead<[ZT0]>, IntrReadOnly]>;
+  let TargetGuards = [StreamingVariant<"sme2", SmeLuti4LaneZtX4Types>] in
   def int_aarch64_sme_luti4_lane_zt_x4
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
                             [llvm_i32_ty, llvm_nxv16i8_ty, llvm_i32_ty],
                             [ImmArg<ArgIndex<0>>, ImmArg<ArgIndex<2>>, IntrRead<[ZT0]>, IntrReadOnly]>;
-  def int_aarch64_sme_luti6_lane_x4_x2
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
+  let TargetGuards = [StreamingVariant<"sme2p3", BF16_F16_I16_Overloads>] in {
+    def int_aarch64_sme_luti6_lane_x4_x2
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
                             [LLVMMatchType<0>, LLVMMatchType<0>, llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_i32_ty],
                             [ImmArg<ArgIndex<4>>, IntrNoMem, IntrSpeculatable]>;
-  def int_aarch64_sme_luti6_lane_x4_x3
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
+    def int_aarch64_sme_luti6_lane_x4_x3
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
                             [LLVMMatchType<0>, LLVMMatchType<0>, llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_i32_ty],
                             [ImmArg<ArgIndex<5>>, IntrNoMem, IntrSpeculatable]>;
+  }
 
+  let TargetGuards = [StreamingVariant<"sme-lutv2", I8_Overloads>] in
   def int_aarch64_sme_luti4_zt_x4
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
                             [llvm_i32_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty],
                             [ImmArg<ArgIndex<0>>, IntrRead<[ZT0]>, IntrReadOnly]>;
+  let TargetGuards = [StreamingVariant<"sme2p3", EmptyOverload>] in
   def int_aarch64_sme_luti6_zt_x4
-    : DefaultAttrsIntrinsic<[llvm_nxv16i8_ty, llvm_nxv16i8_ty,
+    : GuardedDefaultIntrinsic<[llvm_nxv16i8_ty, llvm_nxv16i8_ty,
                              llvm_nxv16i8_ty, llvm_nxv16i8_ty],
                             [llvm_i32_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty],
                             [ImmArg<ArgIndex<0>>, IntrRead<[ZT0]>, IntrReadOnly]>;
 
-
   //
   // Register scaling
   //
-  def int_aarch64_sme_fp8_scale_single_x2
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  let TargetGuards = [StreamingVariant<"sme2,fp8", F16_F32_F64_Overloads>] in {
+    def int_aarch64_sme_fp8_scale_single_x2
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                             [LLVMMatchType<0>, LLVMMatchType<0>, LLVMVectorOfBitcastsToInt<0>],
                             [IntrNoMem]>;
-
-  def int_aarch64_sme_fp8_scale_single_x4
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
+    def int_aarch64_sme_fp8_scale_single_x4
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
                             [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>, LLVMVectorOfBitcastsToInt<0>],
                             [IntrNoMem]>;
-
-  def int_aarch64_sme_fp8_scale_x2
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+    def int_aarch64_sme_fp8_scale_x2
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                             [LLVMMatchType<0>, LLVMMatchType<0>,
                              LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>],
                             [IntrNoMem]>;
-
-  def int_aarch64_sme_fp8_scale_x4
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
+    def int_aarch64_sme_fp8_scale_x4
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>],
                             [LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>, LLVMMatchType<0>,
                              LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>, LLVMVectorOfBitcastsToInt<0>],
                             [IntrNoMem]>;
+  }
 
-
-   //
-   // SVE2.3/SME2.3 - Multi-vector narrowing convert to floating point
-   //
-   def int_aarch64_sve_fcvtzsn_x2: AdvSIMD_2Arg_FloatCompare_Intrinsic;
-   def int_aarch64_sve_fcvtzun_x2: AdvSIMD_2Arg_FloatCompare_Intrinsic;
+  //
+  // SVE2.3/SME2.3 - Multi-vector narrowing convert to floating point
+  //
+  defvar SveFcvtzsnX2Types = [
+    [llvm_nxv16i8_ty, LLVMType<nxv8f16>],
+    [llvm_nxv4i32_ty, LLVMType<nxv2f64>],
+    [llvm_nxv8i16_ty, LLVMType<nxv4f32>],
+  ];
+
+  let TargetGuards = [Variant<"sve,(sve2p3|sme2p3)", "sve2p3|sme2p3", SveFcvtzsnX2Types>] in {
+    def int_aarch64_sve_fcvtzsn_x2: Guarded_AdvSIMD_2Arg_FloatCompare_Intrinsic;
+    def int_aarch64_sve_fcvtzun_x2: Guarded_AdvSIMD_2Arg_FloatCompare_Intrinsic;
+  }
 }
 
 // SVE2.1 - ZIPQ1, ZIPQ2, UZPQ1, UZPQ2
 //
-def int_aarch64_sve_zipq1 : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_zipq2 : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uzpq1 : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_uzpq2 : AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2p1|sme2p1)", "sve2p1|sme2p1", AllPackedData_Overloads>] in {
+  def int_aarch64_sve_zipq1 : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_zipq2 : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uzpq1 : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_uzpq2 : Guarded_AdvSIMD_2VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
 
 // SVE2.1 - Programmable table lookup within each quadword vector segment
 // (zeroing)/(merging)
 //
-def int_aarch64_sve_tblq : AdvSIMD_SVE_TBL_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_tbxq : AdvSIMD_SVE2_TBX_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2p1|sme2p1)", "sve2p1|sme2p1", AllPackedData_Overloads>] in {
+  def int_aarch64_sve_tblq : Guarded_AdvSIMD_SVE_TBL_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_tbxq : Guarded_AdvSIMD_SVE2_TBX_Intrinsic<[IntrSpeculatable]>;
+}
 
 // SVE2.1 - Extract vector segment from each pair of quadword segments.
 //
-def int_aarch64_sve_extq : AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2p1|sme2p1)", "sve2p1|sme2p1", AllPackedData_Overloads>] in
+def int_aarch64_sve_extq : Guarded_AdvSIMD_2VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
 
 //
 // SVE2.1 - Move predicate to/from vector
 //
-def int_aarch64_sve_pmov_to_pred_lane : SVE2_1VectorArgIndexed_Pred_Intrinsic<[IntrSpeculatable]>;
-
-def int_aarch64_sve_pmov_to_pred_lane_zero : SVE2_1VectorArg_Pred_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2p1|sme2p1)", "sve2p1|sme2p1", I8_I16_I32_I64_Overloads>] in {
+  def int_aarch64_sve_pmov_to_pred_lane : Guarded_SVE2_1VectorArgIndexed_Pred_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_pmov_to_pred_lane_zero : Guarded_SVE2_1VectorArg_Pred_Intrinsic<[IntrSpeculatable]>;
+  def int_aarch64_sve_pmov_to_vector_lane_zeroing : Guarded_SVE2_Pred_1VectorArg_Intrinsic<[IntrSpeculatable]>;
+}
 
-def int_aarch64_sve_pmov_to_vector_lane_merging : SVE2_Pred_1VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
-def int_aarch64_sve_pmov_to_vector_lane_zeroing : SVE2_Pred_1VectorArg_Intrinsic<[IntrSpeculatable]>;
+let TargetGuards = [Variant<"sve,(sve2p1|sme2p1)", "sve2p1|sme2p1", I16_I32_I64_Overloads>] in
+def int_aarch64_sve_pmov_to_vector_lane_merging : Guarded_SVE2_Pred_1VectorArgIndexed_Intrinsic<[IntrSpeculatable]>;
 
 // SVE2/SME2 - Floating point absolute maximum and minimum
 
-def int_aarch64_sve_famax   : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_famax_u : AdvSIMD_Pred2VectorArg_Intrinsic;
-
-def int_aarch64_sve_famin   : AdvSIMD_Pred2VectorArg_Intrinsic;
-def int_aarch64_sve_famin_u : AdvSIMD_Pred2VectorArg_Intrinsic;
+let TargetGuards = [
+  Variant<"sve,(sve2|sme2),faminmax", "sme2,faminmax", F16_F32_F64_Overloads>,
+] in {
+  def int_aarch64_sve_famax   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_famax_u : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_famin   : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+  def int_aarch64_sve_famin_u : Guarded_AdvSIMD_Pred2VectorArg_Intrinsic;
+}
 // Neon absolute maximum and minimum
 def int_aarch64_neon_famax :  AdvSIMD_2VectorArg_Intrinsic;
 def int_aarch64_neon_famin :  AdvSIMD_2VectorArg_Intrinsic;
@@ -4170,235 +5010,291 @@ def int_aarch64_neon_famin :  AdvSIMD_2VectorArg_Intrinsic;
 let TargetPrefix = "aarch64" in {
 
   // SVE Widening Conversions
-  class SVE2_FP8_Cvt
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_FP8_Cvt
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                             [llvm_nxv16i8_ty],
                             [IntrRead<[FPMR]>, IntrReadOnly]>;
 
-  def int_aarch64_sve_fp8_cvt1   : SVE2_FP8_Cvt;
-  def int_aarch64_sve_fp8_cvt2   : SVE2_FP8_Cvt;
-  def int_aarch64_sve_fp8_cvtlt1 : SVE2_FP8_Cvt;
-  def int_aarch64_sve_fp8_cvtlt2 : SVE2_FP8_Cvt;
+  let TargetGuards = [Variant<"sve,(sve2|sme2),fp8", "sme2,fp8", BF16_F16_Overloads>] in {
+    def int_aarch64_sve_fp8_cvt1   : Guarded_SVE2_FP8_Cvt;
+    def int_aarch64_sve_fp8_cvt2   : Guarded_SVE2_FP8_Cvt;
+    def int_aarch64_sve_fp8_cvtlt1 : Guarded_SVE2_FP8_Cvt;
+    def int_aarch64_sve_fp8_cvtlt2 : Guarded_SVE2_FP8_Cvt;
+  }
 
   // SVE Narrowing Conversions
-  class SVE2_FP8_Narrow_Cvt
-    : DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
+  class Guarded_SVE2_FP8_Narrow_Cvt
+    : GuardedDefaultIntrinsic<[llvm_nxv16i8_ty],
                             [llvm_anyvector_ty, LLVMMatchType<0>],
                             [IntrRead<[FPMR]>, IntrReadOnly]>;
-  def int_aarch64_sve_fp8_cvtn  : SVE2_FP8_Narrow_Cvt;
-  def int_aarch64_sve_fp8_cvtnb : SVE2_FP8_Narrow_Cvt;
-
-  def int_aarch64_sve_fp8_cvtnt
-    : DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
+  let TargetGuards = [
+    Variant<"sve,(sve2|sme2),fp8", "sme2,fp8", [[LLVMType<nxv8bf16>], [LLVMType<nxv8f16>]]>,
+  ] in
+  def int_aarch64_sve_fp8_cvtn  : Guarded_SVE2_FP8_Narrow_Cvt;
+
+  let TargetGuards = [Variant<"sve,(sve2|sme2),fp8", "sme2,fp8", F32_Overloads>] in {
+    def int_aarch64_sve_fp8_cvtnb : Guarded_SVE2_FP8_Narrow_Cvt;
+    def int_aarch64_sve_fp8_cvtnt
+    : GuardedDefaultIntrinsic<[llvm_nxv16i8_ty],
                             [llvm_nxv16i8_ty, llvm_anyvector_ty, LLVMMatchType<0>],
                             [IntrRead<[FPMR]>, IntrReadOnly]>;
+  }
 
   // Dot product
-  class SVE2_FP8_FMLA_FDOT
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_FP8_FMLA_FDOT
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                             [LLVMMatchType<0>,
                              llvm_nxv16i8_ty, llvm_nxv16i8_ty],
                             [IntrRead<[FPMR]>, IntrReadOnly]>;
-  class SVE2_FP8_FMLA_FDOT_Lane
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty],
+  class Guarded_SVE2_FP8_FMLA_FDOT_Lane
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty],
                             [LLVMMatchType<0>,
                              llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_i32_ty],
                             [IntrRead<[FPMR]>, IntrReadOnly, ImmArg<ArgIndex<3>>]>;
-  def int_aarch64_sve_fp8_fdot      : SVE2_FP8_FMLA_FDOT;
-  def int_aarch64_sve_fp8_fdot_lane : SVE2_FP8_FMLA_FDOT_Lane;
+  let TargetGuards = [
+    Variant<"sve2,fp8dot4", "ssve-fp8dot4", F32_Overloads>,
+    Variant<"sve2,fp8dot2", "ssve-fp8dot2", F16_Overloads>,
+  ] in {
+    def int_aarch64_sve_fp8_fdot      : Guarded_SVE2_FP8_FMLA_FDOT;
+    def int_aarch64_sve_fp8_fdot_lane : Guarded_SVE2_FP8_FMLA_FDOT_Lane;
+  }
 
   // Fused multiply-add
-  def int_aarch64_sve_fp8_fmlalb      : SVE2_FP8_FMLA_FDOT;
-  def int_aarch64_sve_fp8_fmlalb_lane : SVE2_FP8_FMLA_FDOT_Lane;
+  let TargetGuards = [Variant<"sve2,fp8fma", "ssve-fp8fma", F16_Overloads>] in {
+    def int_aarch64_sve_fp8_fmlalb      : Guarded_SVE2_FP8_FMLA_FDOT;
+    def int_aarch64_sve_fp8_fmlalb_lane : Guarded_SVE2_FP8_FMLA_FDOT_Lane;
 
-  def int_aarch64_sve_fp8_fmlalt      : SVE2_FP8_FMLA_FDOT;
-  def int_aarch64_sve_fp8_fmlalt_lane : SVE2_FP8_FMLA_FDOT_Lane;
+    def int_aarch64_sve_fp8_fmlalt      : Guarded_SVE2_FP8_FMLA_FDOT;
+    def int_aarch64_sve_fp8_fmlalt_lane : Guarded_SVE2_FP8_FMLA_FDOT_Lane;
+  }
 
-  def int_aarch64_sve_fp8_fmlallbb      : SVE2_FP8_FMLA_FDOT;
-  def int_aarch64_sve_fp8_fmlallbb_lane : SVE2_FP8_FMLA_FDOT_Lane;
+  let TargetGuards = [Variant<"sve2,fp8fma", "ssve-fp8fma", F32_Overloads>] in {
+    def int_aarch64_sve_fp8_fmlallbb      : Guarded_SVE2_FP8_FMLA_FDOT;
+    def int_aarch64_sve_fp8_fmlallbb_lane : Guarded_SVE2_FP8_FMLA_FDOT_Lane;
 
-  def int_aarch64_sve_fp8_fmlallbt      : SVE2_FP8_FMLA_FDOT;
-  def int_aarch64_sve_fp8_fmlallbt_lane : SVE2_FP8_FMLA_FDOT_Lane;
+    def int_aarch64_sve_fp8_fmlallbt      : Guarded_SVE2_FP8_FMLA_FDOT;
+    def int_aarch64_sve_fp8_fmlallbt_lane : Guarded_SVE2_FP8_FMLA_FDOT_Lane;
 
-  def int_aarch64_sve_fp8_fmlalltb      : SVE2_FP8_FMLA_FDOT;
-  def int_aarch64_sve_fp8_fmlalltb_lane : SVE2_FP8_FMLA_FDOT_Lane;
+    def int_aarch64_sve_fp8_fmlalltb      : Guarded_SVE2_FP8_FMLA_FDOT;
+    def int_aarch64_sve_fp8_fmlalltb_lane : Guarded_SVE2_FP8_FMLA_FDOT_Lane;
 
-  def int_aarch64_sve_fp8_fmlalltt      : SVE2_FP8_FMLA_FDOT;
-  def int_aarch64_sve_fp8_fmlalltt_lane : SVE2_FP8_FMLA_FDOT_Lane;
+    def int_aarch64_sve_fp8_fmlalltt      : Guarded_SVE2_FP8_FMLA_FDOT;
+    def int_aarch64_sve_fp8_fmlalltt_lane : Guarded_SVE2_FP8_FMLA_FDOT_Lane;
+  }
 
-  class SVE2_FP8_CVT_X2_Single_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
+  class Guarded_SVE2_FP8_CVT_X2_Single_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_anyvector_ty, LLVMMatchType<0>],
                             [llvm_nxv16i8_ty],
                             [IntrRead<[FPMR]>, IntrReadOnly]>;
 
-  class SVE2_FP8_CVT_Single_X4_Intrinsic
-    : DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
+  class Guarded_SVE2_FP8_CVT_Single_X4_Intrinsic
+    : GuardedDefaultIntrinsic<[llvm_nxv16i8_ty],
                             [llvm_nxv4f32_ty, llvm_nxv4f32_ty, llvm_nxv4f32_ty, llvm_nxv4f32_ty],
                             [IntrRead<[FPMR]>, IntrReadOnly]>;
 
-  class SME_FP8_OuterProduct_Intrinsic
-      : DefaultAttrsIntrinsic<[],
+  class Guarded_SME_FP8_OuterProduct_Intrinsic
+      : GuardedDefaultIntrinsic<[],
           [llvm_i32_ty,
           llvm_nxv16i1_ty, llvm_nxv16i1_ty,
           llvm_nxv16i8_ty, llvm_nxv16i8_ty],
           [ImmArg<ArgIndex<0>>, IntrRead<[FPMR, ZA]>, IntrWrite<[ZA]>]>;
 
-  class SME_FP8_ZA_LANE_VGx1_Intrinsic
-   : DefaultAttrsIntrinsic<[], [llvm_i32_ty,
+  class Guarded_SME_FP8_ZA_LANE_VGx1_Intrinsic
+   : GuardedDefaultIntrinsic<[], [llvm_i32_ty,
                                llvm_nxv16i8_ty,
                                llvm_nxv16i8_ty,
                                llvm_i32_ty],
                           [IntrRead<[FPMR, ZA]>, IntrWrite<[ZA]>, ImmArg<ArgIndex<3>>]>;
 
-  class SME_FP8_ZA_LANE_VGx2_Intrinsic
-    : DefaultAttrsIntrinsic<[], [llvm_i32_ty,
+  class Guarded_SME_FP8_ZA_LANE_VGx2_Intrinsic
+    : GuardedDefaultIntrinsic<[], [llvm_i32_ty,
                                 llvm_nxv16i8_ty, llvm_nxv16i8_ty,
                                 llvm_nxv16i8_ty,
                                 llvm_i32_ty],
                             [IntrRead<[FPMR, ZA]>, IntrWrite<[ZA]>, ImmArg<ArgIndex<4>>]>;
 
-  class SME_FP8_ZA_LANE_VGx4_Intrinsic
-   : DefaultAttrsIntrinsic<[], [llvm_i32_ty,
+  class Guarded_SME_FP8_ZA_LANE_VGx4_Intrinsic
+   : GuardedDefaultIntrinsic<[], [llvm_i32_ty,
                                 llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty,
                                 llvm_nxv16i8_ty,
                                 llvm_i32_ty],
                             [IntrRead<[FPMR, ZA]>, IntrWrite<[ZA]>, ImmArg<ArgIndex<6>>]>;
 
-  class SME_FP8_ZA_VGx1_Intrinsic
-    : DefaultAttrsIntrinsic<[], [llvm_i32_ty,
+  class Guarded_SME_FP8_ZA_VGx1_Intrinsic
+    : GuardedDefaultIntrinsic<[], [llvm_i32_ty,
                                 llvm_nxv16i8_ty,
                                 llvm_nxv16i8_ty],
                             [IntrRead<[FPMR, ZA]>, IntrWrite<[ZA]>]>;
 
-  class SME_FP8_ZA_SINGLE_VGx2_Intrinsic
-    : DefaultAttrsIntrinsic<[], [llvm_i32_ty,
+  class Guarded_SME_FP8_ZA_SINGLE_VGx2_Intrinsic
+    : GuardedDefaultIntrinsic<[], [llvm_i32_ty,
                                 llvm_nxv16i8_ty, llvm_nxv16i8_ty,
                                 llvm_nxv16i8_ty],
                             [IntrRead<[FPMR, ZA]>, IntrWrite<[ZA]>]>;
 
-  class SME_FP8_ZA_SINGLE_VGx4_Intrinsic
-    : DefaultAttrsIntrinsic<[], [llvm_i32_ty,
+  class Guarded_SME_FP8_ZA_SINGLE_VGx4_Intrinsic
+    : GuardedDefaultIntrinsic<[], [llvm_i32_ty,
                                 llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty,
                                 llvm_nxv16i8_ty],
                               [IntrRead<[FPMR, ZA]>, IntrWrite<[ZA]>]>;
 
-  class SME_FP8_ZA_MULTI_VGx2_Intrinsic
-    : DefaultAttrsIntrinsic<[], [llvm_i32_ty,
+  class Guarded_SME_FP8_ZA_MULTI_VGx2_Intrinsic
+    : GuardedDefaultIntrinsic<[], [llvm_i32_ty,
                                  llvm_nxv16i8_ty, llvm_nxv16i8_ty,
                                  llvm_nxv16i8_ty, llvm_nxv16i8_ty],
                             [IntrRead<[FPMR, ZA]>, IntrWrite<[ZA]>]>;
 
-  class SME_FP8_ZA_MULTI_VGx4_Intrinsic
-    : DefaultAttrsIntrinsic<[], [llvm_i32_ty,
+  class Guarded_SME_FP8_ZA_MULTI_VGx4_Intrinsic
+    : GuardedDefaultIntrinsic<[], [llvm_i32_ty,
                                  llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty,
                                  llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty],
                             [IntrRead<[FPMR, ZA]>, IntrWrite<[ZA]>]>;
   //
   // CVT from FP8 to half-precision/BFloat16 multi-vector
   //
-  def int_aarch64_sve_fp8_cvt1_x2 : SVE2_FP8_CVT_X2_Single_Intrinsic;
-  def int_aarch64_sve_fp8_cvt2_x2 : SVE2_FP8_CVT_X2_Single_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2,fp8", BF16_F16_Overloads>] in {
+    def int_aarch64_sve_fp8_cvt1_x2 : Guarded_SVE2_FP8_CVT_X2_Single_Intrinsic;
+    def int_aarch64_sve_fp8_cvt2_x2 : Guarded_SVE2_FP8_CVT_X2_Single_Intrinsic;
+  }
 
   //
   // CVT from FP8 to deinterleaved half-precision/BFloat16 multi-vector
   //
-  def int_aarch64_sve_fp8_cvtl1_x2 : SVE2_FP8_CVT_X2_Single_Intrinsic;
-  def int_aarch64_sve_fp8_cvtl2_x2 : SVE2_FP8_CVT_X2_Single_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2,fp8", BF16_F16_Overloads>] in {
+    def int_aarch64_sve_fp8_cvtl1_x2 : Guarded_SVE2_FP8_CVT_X2_Single_Intrinsic;
+    def int_aarch64_sve_fp8_cvtl2_x2 : Guarded_SVE2_FP8_CVT_X2_Single_Intrinsic;
+  }
 
   //
   // CVT to FP8 from half-precision/BFloat16/single-precision multi-vector
   //
+  let TargetGuards = [StreamingVariant<"sme2,fp8", [[LLVMType<nxv8bf16>], [LLVMType<nxv8f16>]]>] in
   def int_aarch64_sve_fp8_cvt_x2
-    : DefaultAttrsIntrinsic<[llvm_nxv16i8_ty],
+    : GuardedDefaultIntrinsic<[llvm_nxv16i8_ty],
                             [llvm_anyvector_ty, LLVMMatchType<0>],
                             [IntrRead<[FPMR]>, IntrReadOnly]>;
 
-  def int_aarch64_sve_fp8_cvt_x4  : SVE2_FP8_CVT_Single_X4_Intrinsic;
-  def int_aarch64_sve_fp8_cvtn_x4 : SVE2_FP8_CVT_Single_X4_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme2,fp8", EmptyOverload>] in {
+    def int_aarch64_sve_fp8_cvt_x4  : Guarded_SVE2_FP8_CVT_Single_X4_Intrinsic;
+    def int_aarch64_sve_fp8_cvtn_x4 : Guarded_SVE2_FP8_CVT_Single_X4_Intrinsic;
+  }
 
   // FP8 outer product
-  def int_aarch64_sme_fp8_fmopa_za16 : SME_FP8_OuterProduct_Intrinsic;
-  def int_aarch64_sme_fp8_fmopa_za32 : SME_FP8_OuterProduct_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f16", EmptyOverload>] in
+  def int_aarch64_sme_fp8_fmopa_za16 : Guarded_SME_FP8_OuterProduct_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f32", EmptyOverload>] in
+  def int_aarch64_sme_fp8_fmopa_za32 : Guarded_SME_FP8_OuterProduct_Intrinsic;
 
   //
   // ZA multiply-add
   //
   // Double-vector groups (F8F16)
-  def int_aarch64_sme_fp8_fmlal_lane_za16_vg2x1 : SME_FP8_ZA_LANE_VGx1_Intrinsic;
-  def int_aarch64_sme_fp8_fmlal_lane_za16_vg2x2 : SME_FP8_ZA_LANE_VGx2_Intrinsic;
-  def int_aarch64_sme_fp8_fmlal_lane_za16_vg2x4 : SME_FP8_ZA_LANE_VGx4_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f16", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fmlal_lane_za16_vg2x1 : Guarded_SME_FP8_ZA_LANE_VGx1_Intrinsic;
+    def int_aarch64_sme_fp8_fmlal_lane_za16_vg2x2 : Guarded_SME_FP8_ZA_LANE_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fmlal_lane_za16_vg2x4 : Guarded_SME_FP8_ZA_LANE_VGx4_Intrinsic;
+  }
   // Single-Single
-  def int_aarch64_sme_fp8_fmlal_za16_vg2x1 : SME_FP8_ZA_VGx1_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f16", EmptyOverload>] in
+  def int_aarch64_sme_fp8_fmlal_za16_vg2x1 : Guarded_SME_FP8_ZA_VGx1_Intrinsic;
   // Multi-Single
-  def int_aarch64_sme_fp8_fmlal_single_za16_vg2x2 : SME_FP8_ZA_SINGLE_VGx2_Intrinsic;
-  def int_aarch64_sme_fp8_fmlal_single_za16_vg2x4 : SME_FP8_ZA_SINGLE_VGx4_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f16", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fmlal_single_za16_vg2x2 : Guarded_SME_FP8_ZA_SINGLE_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fmlal_single_za16_vg2x4 : Guarded_SME_FP8_ZA_SINGLE_VGx4_Intrinsic;
+  }
   // Multi-Multi
-  def int_aarch64_sme_fp8_fmlal_multi_za16_vg2x2 : SME_FP8_ZA_MULTI_VGx2_Intrinsic;
-  def int_aarch64_sme_fp8_fmlal_multi_za16_vg2x4 : SME_FP8_ZA_MULTI_VGx4_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f16", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fmlal_multi_za16_vg2x2 : Guarded_SME_FP8_ZA_MULTI_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fmlal_multi_za16_vg2x4 : Guarded_SME_FP8_ZA_MULTI_VGx4_Intrinsic;
+  }
 
   // Quad-vector groups (F8F32)
-  def int_aarch64_sme_fp8_fmlall_lane_za32_vg4x1 : SME_FP8_ZA_LANE_VGx1_Intrinsic;
-  def int_aarch64_sme_fp8_fmlall_lane_za32_vg4x2 : SME_FP8_ZA_LANE_VGx2_Intrinsic;
-  def int_aarch64_sme_fp8_fmlall_lane_za32_vg4x4 : SME_FP8_ZA_LANE_VGx4_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f32", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fmlall_lane_za32_vg4x1 : Guarded_SME_FP8_ZA_LANE_VGx1_Intrinsic;
+    def int_aarch64_sme_fp8_fmlall_lane_za32_vg4x2 : Guarded_SME_FP8_ZA_LANE_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fmlall_lane_za32_vg4x4 : Guarded_SME_FP8_ZA_LANE_VGx4_Intrinsic;
+  }
   // Single-Single
-  def int_aarch64_sme_fp8_fmlall_za32_vg4x1 : SME_FP8_ZA_VGx1_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f32", EmptyOverload>] in
+  def int_aarch64_sme_fp8_fmlall_za32_vg4x1 : Guarded_SME_FP8_ZA_VGx1_Intrinsic;
   // Multi-Single
-  def int_aarch64_sme_fp8_fmlall_single_za32_vg4x2 : SME_FP8_ZA_SINGLE_VGx2_Intrinsic;
-  def int_aarch64_sme_fp8_fmlall_single_za32_vg4x4 : SME_FP8_ZA_SINGLE_VGx4_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f32", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fmlall_single_za32_vg4x2 : Guarded_SME_FP8_ZA_SINGLE_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fmlall_single_za32_vg4x4 : Guarded_SME_FP8_ZA_SINGLE_VGx4_Intrinsic;
+  }
   // Multi-Multi
-  def int_aarch64_sme_fp8_fmlall_multi_za32_vg4x2 : SME_FP8_ZA_MULTI_VGx2_Intrinsic;
-  def int_aarch64_sme_fp8_fmlall_multi_za32_vg4x4 : SME_FP8_ZA_MULTI_VGx4_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f32", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fmlall_multi_za32_vg4x2 : Guarded_SME_FP8_ZA_MULTI_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fmlall_multi_za32_vg4x4 : Guarded_SME_FP8_ZA_MULTI_VGx4_Intrinsic;
+  }
 
   //
   // FP8 FDOT intrinsics
   //
   // (indexed)
-  def int_aarch64_sme_fp8_fdot_lane_za16_vg1x2 : SME_FP8_ZA_LANE_VGx2_Intrinsic;
-  def int_aarch64_sme_fp8_fdot_lane_za32_vg1x2 : SME_FP8_ZA_LANE_VGx2_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f16", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fdot_lane_za16_vg1x2 : Guarded_SME_FP8_ZA_LANE_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fdot_lane_za16_vg1x4 : Guarded_SME_FP8_ZA_LANE_VGx4_Intrinsic;
+  }
 
-  def int_aarch64_sme_fp8_fdot_lane_za16_vg1x4 : SME_FP8_ZA_LANE_VGx4_Intrinsic;
-  def int_aarch64_sme_fp8_fdot_lane_za32_vg1x4 : SME_FP8_ZA_LANE_VGx4_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f32", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fdot_lane_za32_vg1x2 : Guarded_SME_FP8_ZA_LANE_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fdot_lane_za32_vg1x4 : Guarded_SME_FP8_ZA_LANE_VGx4_Intrinsic;
+  }
   // Single
-  def int_aarch64_sme_fp8_fdot_single_za16_vg1x2 : SME_FP8_ZA_SINGLE_VGx2_Intrinsic;
-  def int_aarch64_sme_fp8_fdot_single_za32_vg1x2 : SME_FP8_ZA_SINGLE_VGx2_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f16", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fdot_single_za16_vg1x2 : Guarded_SME_FP8_ZA_SINGLE_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fdot_single_za16_vg1x4 : Guarded_SME_FP8_ZA_SINGLE_VGx4_Intrinsic;
+  }
 
-  def int_aarch64_sme_fp8_fdot_single_za16_vg1x4 : SME_FP8_ZA_SINGLE_VGx4_Intrinsic;
-  def int_aarch64_sme_fp8_fdot_single_za32_vg1x4 : SME_FP8_ZA_SINGLE_VGx4_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f32", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fdot_single_za32_vg1x2 : Guarded_SME_FP8_ZA_SINGLE_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fdot_single_za32_vg1x4 : Guarded_SME_FP8_ZA_SINGLE_VGx4_Intrinsic;
+  }
   // Multi
-  def int_aarch64_sme_fp8_fdot_multi_za16_vg1x2 : SME_FP8_ZA_MULTI_VGx2_Intrinsic;
-  def int_aarch64_sme_fp8_fdot_multi_za32_vg1x2 : SME_FP8_ZA_MULTI_VGx2_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f16", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fdot_multi_za16_vg1x2 : Guarded_SME_FP8_ZA_MULTI_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fdot_multi_za16_vg1x4 : Guarded_SME_FP8_ZA_MULTI_VGx4_Intrinsic;
+  }
 
-  def int_aarch64_sme_fp8_fdot_multi_za16_vg1x4 : SME_FP8_ZA_MULTI_VGx4_Intrinsic;
-  def int_aarch64_sme_fp8_fdot_multi_za32_vg1x4 : SME_FP8_ZA_MULTI_VGx4_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f32", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fdot_multi_za32_vg1x2 : Guarded_SME_FP8_ZA_MULTI_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fdot_multi_za32_vg1x4 : Guarded_SME_FP8_ZA_MULTI_VGx4_Intrinsic;
+  }
 
   // FVDOT
-  def int_aarch64_sme_fp8_fvdot_lane_za16_vg1x2  : SME_FP8_ZA_LANE_VGx2_Intrinsic;
-  def int_aarch64_sme_fp8_fvdotb_lane_za32_vg1x4 : SME_FP8_ZA_LANE_VGx2_Intrinsic;
-  def int_aarch64_sme_fp8_fvdott_lane_za32_vg1x4 : SME_FP8_ZA_LANE_VGx2_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f16", EmptyOverload>] in
+  def int_aarch64_sme_fp8_fvdot_lane_za16_vg1x2  : Guarded_SME_FP8_ZA_LANE_VGx2_Intrinsic;
+  let TargetGuards = [StreamingVariant<"sme-f8f32", EmptyOverload>] in {
+    def int_aarch64_sme_fp8_fvdotb_lane_za32_vg1x4 : Guarded_SME_FP8_ZA_LANE_VGx2_Intrinsic;
+    def int_aarch64_sme_fp8_fvdott_lane_za32_vg1x4 : Guarded_SME_FP8_ZA_LANE_VGx2_Intrinsic;
+  }
 
   // AES2
-  class SVE2_Crypto_LANE_X2_Intrinsic
-  : DefaultAttrsIntrinsic<[llvm_nxv16i8_ty, llvm_nxv16i8_ty],
+  class Guarded_SVE2_Crypto_LANE_X2_Intrinsic
+  : GuardedDefaultIntrinsic<[llvm_nxv16i8_ty, llvm_nxv16i8_ty],
       [llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_i32_ty],
       [ImmArg<ArgIndex<3>>, IntrNoMem]>;
-  class SVE2_Crypto_LANE_X4_Intrinsic
-  : DefaultAttrsIntrinsic<[llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty],
+  class Guarded_SVE2_Crypto_LANE_X4_Intrinsic
+  : GuardedDefaultIntrinsic<[llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty],
       [llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_nxv16i8_ty,
        llvm_nxv16i8_ty, llvm_nxv16i8_ty, llvm_i32_ty],
       [ImmArg<ArgIndex<5>>, IntrNoMem]>;
 
-  def int_aarch64_sve_aesd_lane_x2 : SVE2_Crypto_LANE_X2_Intrinsic;
-  def int_aarch64_sve_aesdimc_lane_x2 : SVE2_Crypto_LANE_X2_Intrinsic;
-  def int_aarch64_sve_aese_lane_x2 : SVE2_Crypto_LANE_X2_Intrinsic;
-  def int_aarch64_sve_aesemc_lane_x2 : SVE2_Crypto_LANE_X2_Intrinsic;
+  let TargetGuards = [Variant<"sve,sve-aes2", "sve-aes2,ssve-aes", EmptyOverload>] in {
+    def int_aarch64_sve_aesd_lane_x2 : Guarded_SVE2_Crypto_LANE_X2_Intrinsic;
+    def int_aarch64_sve_aesdimc_lane_x2 : Guarded_SVE2_Crypto_LANE_X2_Intrinsic;
+    def int_aarch64_sve_aese_lane_x2 : Guarded_SVE2_Crypto_LANE_X2_Intrinsic;
+    def int_aarch64_sve_aesemc_lane_x2 : Guarded_SVE2_Crypto_LANE_X2_Intrinsic;
 
-  def int_aarch64_sve_aesd_lane_x4 : SVE2_Crypto_LANE_X4_Intrinsic;
-  def int_aarch64_sve_aesdimc_lane_x4 : SVE2_Crypto_LANE_X4_Intrinsic;
-  def int_aarch64_sve_aese_lane_x4 : SVE2_Crypto_LANE_X4_Intrinsic;
-  def int_aarch64_sve_aesemc_lane_x4 : SVE2_Crypto_LANE_X4_Intrinsic;
+    def int_aarch64_sve_aesd_lane_x4 : Guarded_SVE2_Crypto_LANE_X4_Intrinsic;
+    def int_aarch64_sve_aesdimc_lane_x4 : Guarded_SVE2_Crypto_LANE_X4_Intrinsic;
+    def int_aarch64_sve_aese_lane_x4 : Guarded_SVE2_Crypto_LANE_X4_Intrinsic;
+    def int_aarch64_sve_aesemc_lane_x4 : Guarded_SVE2_Crypto_LANE_X4_Intrinsic;
 
-  def int_aarch64_sve_pmull_pair_x2 : DefaultAttrsIntrinsic<[llvm_nxv2i64_ty, llvm_nxv2i64_ty],
+    def int_aarch64_sve_pmull_pair_x2 : GuardedDefaultIntrinsic<[llvm_nxv2i64_ty, llvm_nxv2i64_ty],
       [llvm_nxv2i64_ty, llvm_nxv2i64_ty], [IntrNoMem]>;
-  def int_aarch64_sve_pmlal_pair_x2 : DefaultAttrsIntrinsic<[llvm_nxv2i64_ty, llvm_nxv2i64_ty],
+    def int_aarch64_sve_pmlal_pair_x2 : GuardedDefaultIntrinsic<[llvm_nxv2i64_ty, llvm_nxv2i64_ty],
       [llvm_nxv2i64_ty, llvm_nxv2i64_ty, llvm_nxv2i64_ty, llvm_nxv2i64_ty], [IntrNoMem]>;
+  }
 }
diff --git a/llvm/lib/Target/AArch64/AArch64.h b/llvm/lib/Target/AArch64/AArch64.h
index fc2fc7b8cec60f..dfbdf012a244ea 100644
--- a/llvm/lib/Target/AArch64/AArch64.h
+++ b/llvm/lib/Target/AArch64/AArch64.h
@@ -45,6 +45,7 @@ class AArch64TargetMachine;
 enum class CodeGenOptLevel;
 class FunctionPass;
 class InstructionSelector;
+class IntrinsicInst;
 class ModulePass;
 
 FunctionPass *createAArch64DeadRegisterDefinitions();
@@ -57,6 +58,11 @@ FunctionPass *createAArch64AdvSIMDScalar();
 FunctionPass *createAArch64ISelDag(AArch64TargetMachine &TM,
                                    CodeGenOptLevel OptLevel);
 FunctionPass *createAArch64StorePairSuppressPass();
+FunctionPass *createAArch64IntrinsicsVerifierPass();
+/// Return false if the intrinsic has no generated guards or fails a guard in
+/// any mode the subtarget may use.
+bool isAArch64IntrinsicAvailable(const IntrinsicInst &II,
+                                 const AArch64Subtarget &ST);
 FunctionPass *createAArch64ExpandPseudoLegacyPass();
 FunctionPass *createAArch64SLSHardeningLegacyPass();
 FunctionPass *createAArch64SpeculationHardeningPass();
@@ -181,6 +187,7 @@ void initializeAArch64ConditionalComparesLegacyPass(PassRegistry &);
 void initializeAArch64DAGToDAGISelLegacyPass(PassRegistry &);
 void initializeAArch64DeadRegisterDefinitionsLegacyPass(PassRegistry &);
 void initializeAArch64ExpandPseudoLegacyPass(PassRegistry &);
+void initializeAArch64IntrinsicsVerifierPass(PassRegistry &);
 void initializeAArch64LoadStoreOptLegacyPass(PassRegistry &);
 void initializeAArch64LowerHomogeneousPrologEpilogLegacyPass(PassRegistry &);
 void initializeAArch64CodeLayoutOptPass(PassRegistry &);
diff --git a/llvm/lib/Target/AArch64/AArch64IntrinsicFeatureChecks.td b/llvm/lib/Target/AArch64/AArch64IntrinsicFeatureChecks.td
new file mode 100644
index 00000000000000..8e7c1fdeac12d9
--- /dev/null
+++ b/llvm/lib/Target/AArch64/AArch64IntrinsicFeatureChecks.td
@@ -0,0 +1,3 @@
+// Input for -gen-intrinsic-feature-checks. The AArch64 target
+// definitions include the intrinsic TargetGuards and subtarget features.
+include "AArch64.td"
diff --git a/llvm/lib/Target/AArch64/AArch64IntrinsicsVerifier.cpp b/llvm/lib/Target/AArch64/AArch64IntrinsicsVerifier.cpp
new file mode 100644
index 00000000000000..32a4d63841d846
--- /dev/null
+++ b/llvm/lib/Target/AArch64/AArch64IntrinsicsVerifier.cpp
@@ -0,0 +1,236 @@
+//===- AArch64IntrinsicsVerifier.cpp - Check SVE/SME intrinsic features ---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "AArch64.h"
+#include "AArch64Subtarget.h"
+#include "AArch64TargetMachine.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/CodeGen/TargetPassConfig.h"
+#include "llvm/CodeGen/ValueTypes.h"
+#include "llvm/IR/DataLayout.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/InstIterator.h"
+#include "llvm/IR/InstrTypes.h"
+#include "llvm/IR/Intrinsics.h"
+#include "llvm/IR/IntrinsicsAArch64.h"
+#include "llvm/IR/Type.h"
+#include "llvm/InitializePasses.h"
+#include "llvm/Pass.h"
+#include "llvm/Support/ErrorHandling.h"
+
+using namespace llvm;
+
+#define DEBUG_TYPE "aarch64-intrinsics-verifier"
+
+namespace {
+
+struct IntrinsicFeatureGuard {
+  unsigned FirstClause;
+  unsigned NumClauses;
+  const char *Expression;
+};
+
+struct IntrinsicFeatureVariant {
+  unsigned FirstType;
+  unsigned NumResults;
+  unsigned NumInputs;
+  unsigned FirstGuard;
+  unsigned NumGuards;
+  bool AppliesToAllTypes;
+};
+
+#include "AArch64GenIntrinsicFeatureChecks.inc"
+
+static_assert(
+    [] {
+      for (const auto &Variant : AArch64IntrinsicVariants)
+        if (Variant.NumGuards != 2)
+          return false;
+      return true;
+    }(),
+    "AArch64 variants need two mode guards");
+
+// A streaming-compatible function can enter streaming mode with SME. These
+// features are the minimum implied by SME and are available in that mode.
+static constexpr FeatureBitset AArch64StreamingModeFeatures = {
+    AArch64::FeatureBF16, AArch64::FeatureFPARMv8, AArch64::FeatureFullFP16,
+    AArch64::FeatureNEON, AArch64::FeatureSME};
+
+static bool matchesType(Type *Actual, MVT::SimpleValueType Expected,
+                        const DataLayout &DL) {
+  if (Expected == MVT::iPTR)
+    return Actual->isPointerTy();
+  if (auto *Vector = dyn_cast<VectorType>(Actual)) {
+    if (auto *Pointer = dyn_cast<PointerType>(Vector->getElementType())) {
+      MVT Element = MVT::getIntegerVT(
+          DL.getPointerSizeInBits(Pointer->getAddressSpace()));
+      return MVT::getVectorVT(Element, Vector->getElementCount()) == Expected;
+    }
+    if (MVT::getVT(Vector->getElementType(), /*HandleUnknown=*/true) ==
+        MVT::Other)
+      return false;
+  }
+  return MVT::getVT(Actual, /*HandleUnknown=*/true) == Expected;
+}
+
+static bool matchesSignature(const IntrinsicInst &Call,
+                             const IntrinsicFeatureVariant &V) {
+  if (V.AppliesToAllTypes)
+    return true;
+  if (Call.arg_size() != V.NumInputs)
+    return false;
+
+  ArrayRef Types(AArch64IntrinsicTypes + V.FirstType,
+                 V.NumResults + V.NumInputs);
+  const DataLayout &DL = Call.getDataLayout();
+  Type *Result = Call.getType();
+  if (V.NumResults == 0) {
+    if (!Result->isVoidTy())
+      return false;
+  } else if (V.NumResults == 1) {
+    if (!matchesType(Result, Types[0], DL))
+      return false;
+  } else {
+    auto *Struct = dyn_cast<StructType>(Result);
+    if (!Struct || Struct->getNumElements() != V.NumResults)
+      return false;
+    for (unsigned I = 0; I < V.NumResults; ++I)
+      if (!matchesType(Struct->getElementType(I), Types[I], DL))
+        return false;
+  }
+
+  for (unsigned I = 0; I < V.NumInputs; ++I)
+    if (!matchesType(Call.getArgOperand(I)->getType(), Types[V.NumResults + I],
+                     DL))
+      return false;
+  return true;
+}
+
+static bool hasFeatures(const IntrinsicFeatureGuard &Guard,
+                        const FeatureBitset &Available) {
+  for (unsigned I = 0; I < Guard.NumClauses; ++I) {
+    const FeatureBitset &Required =
+        AArch64IntrinsicFeatureClauses[Guard.FirstClause + I];
+    if ((Available & Required) == Required)
+      return true;
+  }
+  return false;
+}
+
+struct IntrinsicCheckResult {
+  bool HasGuards = false;
+  bool FoundSignature = false;
+  bool Valid = false;
+  const IntrinsicFeatureGuard *Failed = nullptr;
+  StringRef FailedMode;
+};
+
+static IntrinsicCheckResult checkIntrinsic(const IntrinsicInst &II,
+                                           const AArch64Subtarget &ST) {
+  IntrinsicCheckResult Result;
+  ArrayRef Variants = getAArch64IntrinsicVariants(II.getIntrinsicID());
+  if (Variants.empty())
+    return Result;
+  Result.HasGuards = true;
+
+  const FeatureBitset &Available = ST.getFeatureBits();
+  const bool Streaming = ST.isStreaming();
+  const bool BothModes = ST.isStreamingCompatible() && !Streaming;
+  // A streaming-compatible function can enter streaming mode with SME.
+  const FeatureBitset StreamingAvailable =
+      BothModes ? Available | AArch64StreamingModeFeatures : Available;
+
+  for (const auto &V : Variants) {
+    if (!matchesSignature(II, V))
+      continue;
+    Result.FoundSignature = true;
+    // AArch64 uses guard 0 for non-streaming mode and guard 1 for
+    // streaming mode.
+    const auto &NonStreamingGuard = AArch64IntrinsicFeatureGuards
+        [AArch64IntrinsicGuardIndices[V.FirstGuard]];
+    const auto &StreamingGuard = AArch64IntrinsicFeatureGuards
+        [AArch64IntrinsicGuardIndices[V.FirstGuard + 1]];
+    if ((!Streaming || BothModes) &&
+        !hasFeatures(NonStreamingGuard, Available)) {
+      Result.Failed = &NonStreamingGuard;
+      Result.FailedMode = "non-streaming";
+      continue;
+    }
+    if ((Streaming || BothModes) &&
+        !hasFeatures(StreamingGuard, StreamingAvailable)) {
+      Result.Failed = &StreamingGuard;
+      Result.FailedMode = "streaming";
+      continue;
+    }
+    Result.Valid = true;
+    break;
+  }
+  return Result;
+}
+
+class AArch64IntrinsicsVerifier : public FunctionPass {
+public:
+  static char ID;
+
+  AArch64IntrinsicsVerifier() : FunctionPass(ID) {}
+
+  StringRef getPassName() const override {
+    return "AArch64 Intrinsics Verifier";
+  }
+
+  void getAnalysisUsage(AnalysisUsage &AU) const override {
+    AU.addRequired<TargetPassConfig>();
+    AU.setPreservesAll();
+  }
+
+  bool runOnFunction(Function &F) override {
+    const auto &TM =
+        getAnalysis<TargetPassConfig>().getTM<AArch64TargetMachine>();
+    const AArch64Subtarget &ST = *TM.getSubtargetImpl(F);
+    for (Instruction &I : instructions(F)) {
+      auto *II = dyn_cast<IntrinsicInst>(&I);
+      if (!II)
+        continue;
+      IntrinsicCheckResult Result = checkIntrinsic(*II, ST);
+      if (!Result.HasGuards || Result.Valid)
+        continue;
+
+      StringRef Name = II->getCalledFunction()->getName();
+      std::string Message = "AArch64 intrinsic '" + Name.str() +
+                            "' in function '" + F.getName().str() + "' ";
+      if (!Result.FoundSignature)
+        Message += "has an unsupported type signature";
+      else if (!Result.Failed->NumClauses)
+        Message += "is unavailable in " + Result.FailedMode.str() + " mode";
+      else
+        Message += "requires " + std::string(Result.Failed->Expression) +
+                   " in " + Result.FailedMode.str() + " mode";
+      reportFatalUsageError(StringRef(Message));
+    }
+    return false;
+  }
+};
+
+} // namespace
+
+bool llvm::isAArch64IntrinsicAvailable(const IntrinsicInst &II,
+                                       const AArch64Subtarget &ST) {
+  return checkIntrinsic(II, ST).Valid;
+}
+
+char AArch64IntrinsicsVerifier::ID = 0;
+
+INITIALIZE_PASS_BEGIN(AArch64IntrinsicsVerifier, DEBUG_TYPE,
+                      "AArch64 Intrinsics Verifier", false, true)
+INITIALIZE_PASS_DEPENDENCY(TargetPassConfig)
+INITIALIZE_PASS_END(AArch64IntrinsicsVerifier, DEBUG_TYPE,
+                    "AArch64 Intrinsics Verifier", false, true)
+
+FunctionPass *llvm::createAArch64IntrinsicsVerifierPass() {
+  return new AArch64IntrinsicsVerifier();
+}
diff --git a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
index e7f4c740ad3189..ed06e6f73d05ab 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
+++ b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
@@ -82,6 +82,7 @@ LLVMInitializeAArch64Target() {
   initializeAArch64ConditionOptimizerLegacyPass(PR);
   initializeAArch64DeadRegisterDefinitionsLegacyPass(PR);
   initializeAArch64ExpandPseudoLegacyPass(PR);
+  initializeAArch64IntrinsicsVerifierPass(PR);
   initializeAArch64LoadStoreOptLegacyPass(PR);
   initializeAArch64MIPeepholeOptLegacyPass(PR);
   initializeAArch64PTrueCoalescingLegacyPass(PR);
@@ -567,6 +568,7 @@ void AArch64PassConfig::addIRPasses() {
 
 // Pass Pipeline Configuration
 bool AArch64PassConfig::addPreISel() {
+  addPass(createAArch64IntrinsicsVerifierPass());
   // Run promote constant before global merge, so that the promoted constants
   // get a chance to be merged
   if (TM->getOptLevel() != CodeGenOptLevel::None && CLOpts.enable_promote_const)
diff --git a/llvm/lib/Target/AArch64/CMakeLists.txt b/llvm/lib/Target/AArch64/CMakeLists.txt
index 14b6f59da5a66b..9b7f9d4a2b3542 100644
--- a/llvm/lib/Target/AArch64/CMakeLists.txt
+++ b/llvm/lib/Target/AArch64/CMakeLists.txt
@@ -9,6 +9,12 @@ llvm_tablegen(AArch64GenCallingConv.inc -gen-callingconv)
 llvm_tablegen(AArch64GenDAGISel.inc -gen-dag-isel)
 llvm_tablegen(AArch64GenDisassemblerTables.inc -gen-disassembler)
 llvm_tablegen(AArch64GenFastISel.inc -gen-fast-isel)
+set(LLVM_TARGET_DEFINITIONS AArch64IntrinsicFeatureChecks.td)
+llvm_tablegen(AArch64GenIntrinsicFeatureChecks.inc -gen-intrinsic-feature-checks
+              -intrinsic-feature-prefix=aarch64 -intrinsic-feature-namespace=AArch64
+              DEPENDS
+              ${LLVM_MAIN_SRC_DIR}/include/llvm/IR/IntrinsicsAArch64.td)
+set(LLVM_TARGET_DEFINITIONS AArch64.td)
 llvm_tablegen(AArch64GenGlobalISel.inc -gen-global-isel -gisel-extended-llt)
 llvm_tablegen(AArch64GenO0PreLegalizeGICombiner.inc -gen-global-isel-combiner
               -combiners="AArch64O0PreLegalizerCombiner")
@@ -72,6 +78,7 @@ add_llvm_target(AArch64CodeGen
   AArch64ISelDAGToDAG.cpp
   AArch64ISelLowering.cpp
   AArch64InstrInfo.cpp
+  AArch64IntrinsicsVerifier.cpp
   AArch64LoadStoreOptimizer.cpp
   AArch64LowerHomogeneousPrologEpilog.cpp
   AArch64MachineFunctionInfo.cpp
diff --git a/llvm/test/CodeGen/AArch64/O0-pipeline.ll b/llvm/test/CodeGen/AArch64/O0-pipeline.ll
index cb59efe3684506..0cf2e37998fa5d 100644
--- a/llvm/test/CodeGen/AArch64/O0-pipeline.ll
+++ b/llvm/test/CodeGen/AArch64/O0-pipeline.ll
@@ -29,6 +29,7 @@
 ; CHECK-NEXT:       AArch64 Stack Tagging
 ; CHECK-NEXT:       SJLJ Exception Handling preparation
 ; CHECK-NEXT:       Exception handling preparation
+; CHECK-NEXT:       AArch64 Intrinsics Verifier
 ; CHECK-NEXT:       Prepare inline asm insts
 ; CHECK-NEXT:       Safe Stack instrumentation pass
 ; CHECK-NEXT:       Insert stack protectors
diff --git a/llvm/test/CodeGen/AArch64/O3-pipeline.ll b/llvm/test/CodeGen/AArch64/O3-pipeline.ll
index 161e87dae4acec..3a2171c9b5363b 100644
--- a/llvm/test/CodeGen/AArch64/O3-pipeline.ll
+++ b/llvm/test/CodeGen/AArch64/O3-pipeline.ll
@@ -98,6 +98,7 @@
 ; CHECK-NEXT:       SJLJ Exception Handling preparation
 ; CHECK-NEXT:       Dominator Tree Construction
 ; CHECK-NEXT:       Exception handling preparation
+; CHECK-NEXT:       AArch64 Intrinsics Verifier
 ; CHECK-NEXT:     AArch64 Promote Constant
 ; CHECK-NEXT:       FunctionPass Manager
 ; CHECK-NEXT:         Dominator Tree Construction
diff --git a/llvm/test/CodeGen/AArch64/intrinsics-target-guards.ll b/llvm/test/CodeGen/AArch64/intrinsics-target-guards.ll
new file mode 100644
index 00000000000000..e5e4102a4c9854
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/intrinsics-target-guards.ll
@@ -0,0 +1,143 @@
+; RUN: split-file %s %t
+; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -filetype=null %t/fadd.ll
+; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -filetype=null %t/fadd-streaming.ll
+; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -filetype=null %t/sme-zero-compatible.ll
+; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme2 -filetype=null %t/sme-zero-zt-both-modes.ll
+; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -filetype=null %t/st2-pointers.ll
+; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -filetype=null %t/fadd-compatible.ll
+; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -filetype=null %t/add-supported.ll
+; RUN: not llc -mtriple=aarch64-linux-gnu -mattr=+sve -filetype=null %t/add-unsupported.ll 2>&1 | FileCheck %s --check-prefix=UNSUPPORTED-TYPES
+; RUN: not llc -mtriple=aarch64-linux-gnu -filetype=null %t/sme-zero-compatible.ll 2>&1 | FileCheck %s --check-prefix=SME-FEATURE
+; RUN: not llc -mtriple=aarch64-linux-gnu -mattr=+sme -filetype=null %t/sme-zero-zt-both-modes.ll 2>&1 | FileCheck %s --check-prefix=ZT-NEEDS-SME2
+; RUN: not llc -mtriple=aarch64-linux-gnu -filetype=null %t/fadd.ll 2>&1 | FileCheck %s --check-prefix=NO-SVE
+; RUN: not llc -mtriple=aarch64-linux-gnu -global-isel -global-isel-abort=0 -filetype=null %t/fadd.ll 2>&1 | FileCheck %s --check-prefix=NO-SVE
+; RUN: not llc -mtriple=aarch64-linux-gnu -mattr=+sve -filetype=null %t/fadd-streaming.ll 2>&1 | FileCheck %s --check-prefix=STREAMING-SME
+; RUN: not llc -mtriple=aarch64-linux-gnu -filetype=null %t/st2-pointers.ll 2>&1 | FileCheck %s --check-prefix=POINTER-VECTOR
+; RUN: not llc -mtriple=aarch64-linux-gnu -mattr=+sme -filetype=null %t/ldnf-streaming.ll 2>&1 | FileCheck %s --check-prefix=BAD-MODE
+; RUN: not llc -mtriple=aarch64-linux-gnu -mattr=+sve -filetype=null %t/fadd-bf16.ll 2>&1 | FileCheck %s --check-prefix=BF16
+; RUN: not llc -mtriple=aarch64-linux-gnu -mattr=+sve,+sve-b16b16 -force-streaming-compatible -filetype=null %t/fadd-bf16.ll 2>&1 | FileCheck %s --check-prefix=COMPATIBLE-EXT
+; RUN: not llc -mtriple=aarch64-linux-gnu -mattr=+sme -filetype=null %t/sme-load-nonstreaming.ll 2>&1 | FileCheck %s --check-prefix=SME-MODE
+; RUN: not llc -mtriple=aarch64-linux-gnu -mattr=+sme2,+sve-b16b16 -filetype=null %t/bfclamp-nonstreaming.ll 2>&1 | FileCheck %s --check-prefix=BFCLAMP-MODE
+; RUN: not llc -mtriple=aarch64-linux-gnu -mattr=+sme2p1 -filetype=null %t/fmaxnmqv-nonstreaming.ll 2>&1 | FileCheck %s --check-prefix=SME2P1-NO-SVE
+
+; NO-SVE: AArch64 intrinsic 'llvm.aarch64.sve.fadd.nxv4f32' in function 'fadd' requires sve in non-streaming mode
+; STREAMING-SME: streaming SVE functions require SME
+; POINTER-VECTOR: AArch64 intrinsic 'llvm.aarch64.sve.st2.nxv2p0.p0' in function 'st2_pointers' requires sve in non-streaming mode
+; BAD-MODE: AArch64 intrinsic 'llvm.aarch64.sve.ldnf1.nxv4f32.p0' in function 'ldnf_streaming' is unavailable in streaming mode
+; BF16: AArch64 intrinsic 'llvm.aarch64.sve.fadd.nxv8bf16' in function 'fadd_bf16' requires sve,sve-b16b16 in non-streaming mode
+; COMPATIBLE-EXT: AArch64 intrinsic 'llvm.aarch64.sve.fadd.nxv8bf16' in function 'fadd_bf16' requires sme2,sve-b16b16 in streaming mode
+; SME-FEATURE: AArch64 intrinsic 'llvm.aarch64.sme.zero' in function 'sme_zero_nonstreaming' requires sme in non-streaming mode
+; ZT-NEEDS-SME2: AArch64 intrinsic 'llvm.aarch64.sme.zero.zt' in function 'zero_zt_nonstreaming' requires sme2 in non-streaming mode
+; SME-MODE: AArch64 intrinsic 'llvm.aarch64.sme.ld1b.horiz.p0' in function 'sme_load_nonstreaming' is unavailable in non-streaming mode
+; BFCLAMP-MODE: AArch64 intrinsic 'llvm.aarch64.sve.bfclamp.single.x2.nxv8bf16' in function 'bfclamp_nonstreaming' is unavailable in non-streaming mode
+; SME2P1-NO-SVE: AArch64 intrinsic 'llvm.aarch64.sve.fmaxnmqv.v4f32.nxv4f32' in function 'fmaxnmqv_nonstreaming' requires sve,(sve2p1|sme2p1) in non-streaming mode
+; UNSUPPORTED-TYPES: AArch64 intrinsic 'llvm.aarch64.sve.add.nxv16i16' in function 'add_unsupported' has an unsupported type signature
+
+;--- add-supported.ll
+declare <vscale x 8 x i16> @llvm.aarch64.sve.add.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>, <vscale x 8 x i16>)
+
+define <vscale x 8 x i16> @add_supported(<vscale x 8 x i1> %pg, <vscale x 8 x i16> %a, <vscale x 8 x i16> %b) {
+  %result = call <vscale x 8 x i16> @llvm.aarch64.sve.add.nxv8i16(<vscale x 8 x i1> %pg, <vscale x 8 x i16> %a, <vscale x 8 x i16> %b)
+  ret <vscale x 8 x i16> %result
+}
+
+;--- add-unsupported.ll
+declare <vscale x 16 x i16> @llvm.aarch64.sve.add.nxv16i16(<vscale x 16 x i1>, <vscale x 16 x i16>, <vscale x 16 x i16>)
+
+define <vscale x 16 x i16> @add_unsupported(<vscale x 16 x i1> %pg, <vscale x 16 x i16> %a, <vscale x 16 x i16> %b) {
+  %result = call <vscale x 16 x i16> @llvm.aarch64.sve.add.nxv16i16(<vscale x 16 x i1> %pg, <vscale x 16 x i16> %a, <vscale x 16 x i16> %b)
+  ret <vscale x 16 x i16> %result
+}
+
+;--- fadd.ll
+declare <vscale x 4 x float> @llvm.aarch64.sve.fadd.nxv4f32(<vscale x 4 x i1>, <vscale x 4 x float>, <vscale x 4 x float>)
+
+define <vscale x 4 x float> @fadd(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
+  %result = call <vscale x 4 x float> @llvm.aarch64.sve.fadd.nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
+  ret <vscale x 4 x float> %result
+}
+
+;--- fadd-streaming.ll
+declare <vscale x 4 x float> @llvm.aarch64.sve.fadd.nxv4f32(<vscale x 4 x i1>, <vscale x 4 x float>, <vscale x 4 x float>)
+
+define <vscale x 4 x float> @fadd_streaming(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) "aarch64_pstate_sm_enabled" {
+  %result = call <vscale x 4 x float> @llvm.aarch64.sve.fadd.nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
+  ret <vscale x 4 x float> %result
+}
+
+;--- ldnf-streaming.ll
+declare <vscale x 4 x float> @llvm.aarch64.sve.ldnf1.nxv4f32(<vscale x 4 x i1>, ptr)
+
+define <vscale x 4 x float> @ldnf_streaming(<vscale x 4 x i1> %pg, ptr %p) "aarch64_pstate_sm_enabled" {
+  %result = call <vscale x 4 x float> @llvm.aarch64.sve.ldnf1.nxv4f32(<vscale x 4 x i1> %pg, ptr %p)
+  ret <vscale x 4 x float> %result
+}
+
+;--- fadd-bf16.ll
+declare <vscale x 8 x bfloat> @llvm.aarch64.sve.fadd.nxv8bf16(<vscale x 8 x i1>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>)
+
+define <vscale x 8 x bfloat> @fadd_bf16(<vscale x 8 x i1> %pg, <vscale x 8 x bfloat> %a, <vscale x 8 x bfloat> %b) {
+  %result = call <vscale x 8 x bfloat> @llvm.aarch64.sve.fadd.nxv8bf16(<vscale x 8 x i1> %pg, <vscale x 8 x bfloat> %a, <vscale x 8 x bfloat> %b)
+  ret <vscale x 8 x bfloat> %result
+}
+
+;--- fadd-compatible.ll
+declare <vscale x 4 x float> @llvm.aarch64.sve.fadd.nxv4f32(<vscale x 4 x i1>, <vscale x 4 x float>, <vscale x 4 x float>)
+
+define <vscale x 4 x float> @fadd_compatible(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) "aarch64_pstate_sm_compatible" {
+  %result = call <vscale x 4 x float> @llvm.aarch64.sve.fadd.nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
+  ret <vscale x 4 x float> %result
+}
+
+;--- sme-zero-compatible.ll
+declare void @llvm.aarch64.sme.zero(i32 immarg)
+
+define void @sme_zero_nonstreaming() {
+  call void @llvm.aarch64.sme.zero(i32 0)
+  ret void
+}
+
+;--- sme-zero-zt-both-modes.ll
+declare void @llvm.aarch64.sme.zero.zt(i32 immarg)
+
+define void @zero_zt_nonstreaming() {
+  call void @llvm.aarch64.sme.zero.zt(i32 0)
+  ret void
+}
+
+define void @zero_zt_streaming() "aarch64_pstate_sm_enabled" {
+  call void @llvm.aarch64.sme.zero.zt(i32 0)
+  ret void
+}
+
+;--- st2-pointers.ll
+declare void @llvm.aarch64.sve.st2.nxv2p0(<vscale x 2 x ptr>, <vscale x 2 x ptr>, <vscale x 2 x i1>, ptr)
+
+define void @st2_pointers(<vscale x 2 x ptr> %a, <vscale x 2 x ptr> %b, <vscale x 2 x i1> %pg, ptr %base) {
+  call void @llvm.aarch64.sve.st2.nxv2p0(<vscale x 2 x ptr> %a, <vscale x 2 x ptr> %b, <vscale x 2 x i1> %pg, ptr %base)
+  ret void
+}
+
+;--- sme-load-nonstreaming.ll
+declare void @llvm.aarch64.sme.ld1b.horiz(<vscale x 16 x i1>, ptr, i32, i32)
+
+define void @sme_load_nonstreaming(<vscale x 16 x i1> %pg, ptr %p) {
+  call void @llvm.aarch64.sme.ld1b.horiz(<vscale x 16 x i1> %pg, ptr %p, i32 0, i32 0)
+  ret void
+}
+
+;--- bfclamp-nonstreaming.ll
+declare { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @llvm.aarch64.sve.bfclamp.single.x2.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>, <vscale x 8 x bfloat>)
+
+define { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @bfclamp_nonstreaming(<vscale x 8 x bfloat> %a, <vscale x 8 x bfloat> %b, <vscale x 8 x bfloat> %c, <vscale x 8 x bfloat> %d) {
+  %result = call { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } @llvm.aarch64.sve.bfclamp.single.x2.nxv8bf16(<vscale x 8 x bfloat> %a, <vscale x 8 x bfloat> %b, <vscale x 8 x bfloat> %c, <vscale x 8 x bfloat> %d)
+  ret { <vscale x 8 x bfloat>, <vscale x 8 x bfloat> } %result
+}
+
+;--- fmaxnmqv-nonstreaming.ll
+declare <4 x float> @llvm.aarch64.sve.fmaxnmqv.v4f32(<vscale x 4 x i1>, <vscale x 4 x float>)
+
+define <4 x float> @fmaxnmqv_nonstreaming(<vscale x 4 x i1> %pg, <vscale x 4 x float> %v) {
+  %result = call <4 x float> @llvm.aarch64.sve.fmaxnmqv.v4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %v)
+  ret <4 x float> %result
+}
diff --git a/llvm/test/CodeGen/AArch64/sve-implicit-zero-filling.ll b/llvm/test/CodeGen/AArch64/sve-implicit-zero-filling.ll
index 60452d7fc89de7..af05e04831a227 100644
--- a/llvm/test/CodeGen/AArch64/sve-implicit-zero-filling.ll
+++ b/llvm/test/CodeGen/AArch64/sve-implicit-zero-filling.ll
@@ -59,39 +59,6 @@ define <vscale x 8 x half> @fmaxv_zero_fill(<vscale x 8 x i1> %pg, <vscale x 8 x
   ret <vscale x 8 x half> %t2
 }
 
-; Ensure we rely on the reduction's implicit zero filling.
-define <vscale x 2 x float> @fmaxnmv_zero_fill(<vscale x 2 x i1> %pg, <vscale x 2 x float> %a) #0 {
-; CHECK-LABEL: fmaxnmv_zero_fill:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    fmaxnmv s0, p0, z0.s
-; CHECK-NEXT:    ret
-  %t1 = call float @llvm.aarch64.sve.fmaxnmv.nxv2f32(<vscale x 2 x i1> %pg, <vscale x 2 x float> %a)
-  %t2 = insertelement <vscale x 2 x float> zeroinitializer, float %t1, i64 0
-  ret <vscale x 2 x float> %t2
-}
-
-; Ensure we rely on the reduction's implicit zero filling.
-define <vscale x 2 x float> @fminnmv_zero_fill(<vscale x 2 x i1> %pg, <vscale x 2 x float> %a) #0 {
-; CHECK-LABEL: fminnmv_zero_fill:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    fminnmv s0, p0, z0.s
-; CHECK-NEXT:    ret
-  %t1 = call float @llvm.aarch64.sve.fminnmv.nxv2f32(<vscale x 2 x i1> %pg, <vscale x 2 x float> %a)
-  %t2 = insertelement <vscale x 2 x float> zeroinitializer, float %t1, i64 0
-  ret <vscale x 2 x float> %t2
-}
-
-; Ensure we rely on the reduction's implicit zero filling.
-define <vscale x 2 x float> @fminv_zero_fill(<vscale x 2 x i1> %pg, <vscale x 2 x float> %a) #0 {
-; CHECK-LABEL: fminv_zero_fill:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    fminv s0, p0, z0.s
-; CHECK-NEXT:    ret
-  %t1 = call float @llvm.aarch64.sve.fminv.nxv2f32(<vscale x 2 x i1> %pg, <vscale x 2 x float> %a)
-  %t2 = insertelement <vscale x 2 x float> zeroinitializer, float %t1, i64 0
-  ret <vscale x 2 x float> %t2
-}
-
 ; Ensure we rely on the reduction's implicit zero filling.
 define <vscale x 4 x i32> @orv_zero_fill(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a) #0 {
 ; CHECK-LABEL: orv_zero_fill:
@@ -226,20 +193,11 @@ declare i8 @llvm.aarch64.sve.andv.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>
 declare i8 @llvm.aarch64.sve.eorv.nxv2i8(<vscale x 2 x i1>, <vscale x 2 x i8>)
 declare i16 @llvm.aarch64.sve.eorv.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>)
 
-declare float @llvm.aarch64.sve.fadda.nxv2f32(<vscale x 2 x i1>, float, <vscale x 2 x float>)
 declare double @llvm.aarch64.sve.fadda.nxv2f64(<vscale x 2 x i1>, double, <vscale x 2 x double>)
 
-declare float @llvm.aarch64.sve.faddv.nxv2f32(<vscale x 2 x i1>, <vscale x 2 x float>)
 declare float @llvm.aarch64.sve.faddv.nxv4f32(<vscale x 4 x i1>, <vscale x 4 x float>)
 
-declare float @llvm.aarch64.sve.fmaxnmv.nxv2f32(<vscale x 2 x i1>, <vscale x 2 x float>)
-
 declare half @llvm.aarch64.sve.fmaxv.nxv8f16(<vscale x 8 x i1>, <vscale x 8 x half>)
-declare float @llvm.aarch64.sve.fmaxv.nxv2f32(<vscale x 2 x i1>, <vscale x 2 x float>)
-
-declare float @llvm.aarch64.sve.fminv.nxv2f32(<vscale x 2 x i1>, <vscale x 2 x float>)
-
-declare float @llvm.aarch64.sve.fminnmv.nxv2f32(<vscale x 2 x i1>, <vscale x 2 x float>)
 
 declare i8 @llvm.aarch64.sve.orv.nxv2i8(<vscale x 2 x i1>, <vscale x 2 x i8>)
 declare i32 @llvm.aarch64.sve.orv.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>)
diff --git a/llvm/test/CodeGen/AArch64/sve-intrinsics-loads-ff.ll b/llvm/test/CodeGen/AArch64/sve-intrinsics-loads-ff.ll
index 7e4e6176800725..3fcaceef7430c3 100644
--- a/llvm/test/CodeGen/AArch64/sve-intrinsics-loads-ff.ll
+++ b/llvm/test/CodeGen/AArch64/sve-intrinsics-loads-ff.ll
@@ -366,25 +366,6 @@ define <vscale x 4 x float> @ldff1w_f32_reg(<vscale x 4 x i1> %pg, ptr %a, i64 %
   ret <vscale x 4 x float> %load
 }
 
-define <vscale x 2 x float> @ldff1w_2f32(<vscale x 2 x i1> %pg, ptr %a) {
-; CHECK-LABEL: ldff1w_2f32:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    ldff1w { z0.d }, p0/z, [x0]
-; CHECK-NEXT:    ret
-  %load = call <vscale x 2 x float> @llvm.aarch64.sve.ldff1.nxv2f32(<vscale x 2 x i1> %pg, ptr %a)
-  ret <vscale x 2 x float> %load
-}
-
-define <vscale x 2 x float> @ldff1w_2f32_reg(<vscale x 2 x i1> %pg, ptr %a, i64 %offset) {
-; CHECK-LABEL: ldff1w_2f32_reg:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    ldff1w { z0.d }, p0/z, [x0, x1, lsl #2]
-; CHECK-NEXT:    ret
-  %base = getelementptr float, ptr %a, i64 %offset
-  %load = call <vscale x 2 x float> @llvm.aarch64.sve.ldff1.nxv2f32(<vscale x 2 x i1> %pg, ptr %base)
-  ret <vscale x 2 x float> %load
-}
-
 ;
 ; LDFF1SW
 ;
@@ -463,7 +444,6 @@ declare <vscale x 8 x bfloat> @llvm.aarch64.sve.ldff1.nxv8bf16(<vscale x 8 x i1>
 declare <vscale x 4 x i8> @llvm.aarch64.sve.ldff1.nxv4i8(<vscale x 4 x i1>, ptr)
 declare <vscale x 4 x i16> @llvm.aarch64.sve.ldff1.nxv4i16(<vscale x 4 x i1>, ptr)
 declare <vscale x 4 x i32> @llvm.aarch64.sve.ldff1.nxv4i32(<vscale x 4 x i1>, ptr)
-declare <vscale x 2 x float> @llvm.aarch64.sve.ldff1.nxv2f32(<vscale x 2 x i1>, ptr)
 declare <vscale x 4 x float> @llvm.aarch64.sve.ldff1.nxv4f32(<vscale x 4 x i1>, ptr)
 
 declare <vscale x 2 x i8> @llvm.aarch64.sve.ldff1.nxv2i8(<vscale x 2 x i1>, ptr)
diff --git a/llvm/test/CodeGen/AArch64/sve-intrinsics-perm-select.ll b/llvm/test/CodeGen/AArch64/sve-intrinsics-perm-select.ll
index cfc37f7fbe1c1d..559bfae7665529 100644
--- a/llvm/test/CodeGen/AArch64/sve-intrinsics-perm-select.ll
+++ b/llvm/test/CodeGen/AArch64/sve-intrinsics-perm-select.ll
@@ -1429,16 +1429,6 @@ define float @lasta_f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a) {
   ret float %res
 }
 
-define float @lasta_f32_v2(<vscale x 2 x i1> %pg, <vscale x 2 x float> %a) {
-; CHECK-LABEL: lasta_f32_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    lasta s0, p0, z0.s
-; CHECK-NEXT:    ret
-  %res = call float @llvm.aarch64.sve.lasta.nxv2f32(<vscale x 2 x i1> %pg,
-                                                    <vscale x 2 x float> %a)
-  ret float %res
-}
-
 define double @lasta_f64(<vscale x 2 x i1> %pg, <vscale x 2 x double> %a) {
 ; CHECK-LABEL: lasta_f64:
 ; CHECK:       // %bb.0:
@@ -1523,16 +1513,6 @@ define float @lastb_f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a) {
   ret float %res
 }
 
-define float @lastb_f32_v2(<vscale x 2 x i1> %pg, <vscale x 2 x float> %a) {
-; CHECK-LABEL: lastb_f32_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    lastb s0, p0, z0.s
-; CHECK-NEXT:    ret
-  %res = call float @llvm.aarch64.sve.lastb.nxv2f32(<vscale x 2 x i1> %pg,
-                                                    <vscale x 2 x float> %a)
-  ret float %res
-}
-
 define double @lastb_f64(<vscale x 2 x i1> %pg, <vscale x 2 x double> %a) {
 ; CHECK-LABEL: lastb_f64:
 ; CHECK:       // %bb.0:
@@ -1600,33 +1580,6 @@ define <vscale x 16 x i1> @rev_nxv16i1(<vscale x 16 x i1> %a) {
   ret <vscale x 16 x i1> %res
 }
 
-define <vscale x 8 x i1> @rev_nxv8i1(<vscale x 8 x i1> %a) {
-; CHECK-LABEL: rev_nxv8i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    rev p0.h, p0.h
-; CHECK-NEXT:    ret
-  %res = call <vscale x 8 x i1> @llvm.aarch64.sve.rev.nxv8i1(<vscale x 8 x i1> %a)
-  ret <vscale x 8 x i1> %res
-}
-
-define <vscale x 4 x i1> @rev_nxv4i1(<vscale x 4 x i1> %a) {
-; CHECK-LABEL: rev_nxv4i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    rev p0.s, p0.s
-; CHECK-NEXT:    ret
-  %res = call <vscale x 4 x i1> @llvm.aarch64.sve.rev.nxv4i1(<vscale x 4 x i1> %a)
-  ret <vscale x 4 x i1> %res
-}
-
-define <vscale x 2 x i1> @rev_nxv2i1(<vscale x 2 x i1> %a) {
-; CHECK-LABEL: rev_nxv2i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    rev p0.d, p0.d
-; CHECK-NEXT:    ret
-  %res = call <vscale x 2 x i1> @llvm.aarch64.sve.rev.nxv2i1(<vscale x 2 x i1> %a)
-  ret <vscale x 2 x i1> %res
-}
-
 define <vscale x 16 x i1> @rev_b16(<vscale x 16 x i1> %a) {
 ; CHECK-LABEL: rev_b16:
 ; CHECK:       // %bb.0:
@@ -2192,36 +2145,6 @@ define <vscale x 16 x i1> @trn1_nxv16i1(<vscale x 16 x i1> %a, <vscale x 16 x i1
   ret <vscale x 16 x i1> %out
 }
 
-define <vscale x 8 x i1> @trn1_nxv8i1(<vscale x 8 x i1> %a, <vscale x 8 x i1> %b) {
-; CHECK-LABEL: trn1_nxv8i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    trn1 p0.h, p0.h, p1.h
-; CHECK-NEXT:    ret
-  %out = call <vscale x 8 x i1> @llvm.aarch64.sve.trn1.nxv8i1(<vscale x 8 x i1> %a,
-                                                              <vscale x 8 x i1> %b)
-  ret <vscale x 8 x i1> %out
-}
-
-define <vscale x 4 x i1> @trn1_nxv4i1(<vscale x 4 x i1> %a, <vscale x 4 x i1> %b) {
-; CHECK-LABEL: trn1_nxv4i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    trn1 p0.s, p0.s, p1.s
-; CHECK-NEXT:    ret
-  %out = call <vscale x 4 x i1> @llvm.aarch64.sve.trn1.nxv4i1(<vscale x 4 x i1> %a,
-                                                              <vscale x 4 x i1> %b)
-  ret <vscale x 4 x i1> %out
-}
-
-define <vscale x 2 x i1> @trn1_nxv2i1(<vscale x 2 x i1> %a, <vscale x 2 x i1> %b) {
-; CHECK-LABEL: trn1_nxv2i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    trn1 p0.d, p0.d, p1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x i1> @llvm.aarch64.sve.trn1.nxv2i1(<vscale x 2 x i1> %a,
-                                                              <vscale x 2 x i1> %b)
-  ret <vscale x 2 x i1> %out
-}
-
 define <vscale x 16 x i1> @trn1_b16(<vscale x 16 x i1> %a, <vscale x 16 x i1> %b) {
 ; CHECK-LABEL: trn1_b16:
 ; CHECK:       // %bb.0:
@@ -2292,26 +2215,6 @@ define <vscale x 2 x i64> @trn1_i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b
   ret <vscale x 2 x i64> %out
 }
 
-define <vscale x 2 x half> @trn1_f16_v2(<vscale x 2 x half> %a, <vscale x 2 x half> %b) {
-; CHECK-LABEL: trn1_f16_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    trn1 z0.d, z0.d, z1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x half> @llvm.aarch64.sve.trn1.nxv2f16(<vscale x 2 x half> %a,
-                                                                 <vscale x 2 x half> %b)
-  ret <vscale x 2 x half> %out
-}
-
-define <vscale x 4 x half> @trn1_f16_v4(<vscale x 4 x half> %a, <vscale x 4 x half> %b) {
-; CHECK-LABEL: trn1_f16_v4:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    trn1 z0.s, z0.s, z1.s
-; CHECK-NEXT:    ret
-  %out = call <vscale x 4 x half> @llvm.aarch64.sve.trn1.nxv4f16(<vscale x 4 x half> %a,
-                                                                 <vscale x 4 x half> %b)
-  ret <vscale x 4 x half> %out
-}
-
 define <vscale x 8 x bfloat> @trn1_bf16(<vscale x 8 x bfloat> %a, <vscale x 8 x bfloat> %b) #0 {
 ; CHECK-LABEL: trn1_bf16:
 ; CHECK:       // %bb.0:
@@ -2332,16 +2235,6 @@ define <vscale x 8 x half> @trn1_f16(<vscale x 8 x half> %a, <vscale x 8 x half>
   ret <vscale x 8 x half> %out
 }
 
-define <vscale x 2 x float> @trn1_f32_v2(<vscale x 2 x float> %a, <vscale x 2 x float> %b) {
-; CHECK-LABEL: trn1_f32_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    trn1 z0.d, z0.d, z1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x float> @llvm.aarch64.sve.trn1.nxv2f32(<vscale x 2 x float> %a,
-                                                                  <vscale x 2 x float> %b)
-  ret <vscale x 2 x float> %out
-}
-
 define <vscale x 4 x float> @trn1_f32(<vscale x 4 x float> %a, <vscale x 4 x float> %b) {
 ; CHECK-LABEL: trn1_f32:
 ; CHECK:       // %bb.0:
@@ -2376,36 +2269,6 @@ define <vscale x 16 x i1> @trn2_nxv16i1(<vscale x 16 x i1> %a, <vscale x 16 x i1
   ret <vscale x 16 x i1> %out
 }
 
-define <vscale x 8 x i1> @trn2_nxv8i1(<vscale x 8 x i1> %a, <vscale x 8 x i1> %b) {
-; CHECK-LABEL: trn2_nxv8i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    trn2 p0.h, p0.h, p1.h
-; CHECK-NEXT:    ret
-  %out = call <vscale x 8 x i1> @llvm.aarch64.sve.trn2.nxv8i1(<vscale x 8 x i1> %a,
-                                                              <vscale x 8 x i1> %b)
-  ret <vscale x 8 x i1> %out
-}
-
-define <vscale x 4 x i1> @trn2_nxv4i1(<vscale x 4 x i1> %a, <vscale x 4 x i1> %b) {
-; CHECK-LABEL: trn2_nxv4i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    trn2 p0.s, p0.s, p1.s
-; CHECK-NEXT:    ret
-  %out = call <vscale x 4 x i1> @llvm.aarch64.sve.trn2.nxv4i1(<vscale x 4 x i1> %a,
-                                                              <vscale x 4 x i1> %b)
-  ret <vscale x 4 x i1> %out
-}
-
-define <vscale x 2 x i1> @trn2_nxv2i1(<vscale x 2 x i1> %a, <vscale x 2 x i1> %b) {
-; CHECK-LABEL: trn2_nxv2i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    trn2 p0.d, p0.d, p1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x i1> @llvm.aarch64.sve.trn2.nxv2i1(<vscale x 2 x i1> %a,
-                                                              <vscale x 2 x i1> %b)
-  ret <vscale x 2 x i1> %out
-}
-
 define <vscale x 16 x i1> @trn2_b16(<vscale x 16 x i1> %a, <vscale x 16 x i1> %b) {
 ; CHECK-LABEL: trn2_b16:
 ; CHECK:       // %bb.0:
@@ -2476,26 +2339,6 @@ define <vscale x 2 x i64> @trn2_i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b
   ret <vscale x 2 x i64> %out
 }
 
-define <vscale x 2 x half> @trn2_f16_v2(<vscale x 2 x half> %a, <vscale x 2 x half> %b) {
-; CHECK-LABEL: trn2_f16_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    trn2 z0.d, z0.d, z1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x half> @llvm.aarch64.sve.trn2.nxv2f16(<vscale x 2 x half> %a,
-                                                                 <vscale x 2 x half> %b)
-  ret <vscale x 2 x half> %out
-}
-
-define <vscale x 4 x half> @trn2_f16_v4(<vscale x 4 x half> %a, <vscale x 4 x half> %b) {
-; CHECK-LABEL: trn2_f16_v4:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    trn2 z0.s, z0.s, z1.s
-; CHECK-NEXT:    ret
-  %out = call <vscale x 4 x half> @llvm.aarch64.sve.trn2.nxv4f16(<vscale x 4 x half> %a,
-                                                                 <vscale x 4 x half> %b)
-  ret <vscale x 4 x half> %out
-}
-
 define <vscale x 8 x bfloat> @trn2_bf16(<vscale x 8 x bfloat> %a, <vscale x 8 x bfloat> %b) #0 {
 ; CHECK-LABEL: trn2_bf16:
 ; CHECK:       // %bb.0:
@@ -2516,16 +2359,6 @@ define <vscale x 8 x half> @trn2_f16(<vscale x 8 x half> %a, <vscale x 8 x half>
   ret <vscale x 8 x half> %out
 }
 
-define <vscale x 2 x float> @trn2_f32_v2(<vscale x 2 x float> %a, <vscale x 2 x float> %b) {
-; CHECK-LABEL: trn2_f32_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    trn2 z0.d, z0.d, z1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x float> @llvm.aarch64.sve.trn2.nxv2f32(<vscale x 2 x float> %a,
-                                                                  <vscale x 2 x float> %b)
-  ret <vscale x 2 x float> %out
-}
-
 define <vscale x 4 x float> @trn2_f32(<vscale x 4 x float> %a, <vscale x 4 x float> %b) {
 ; CHECK-LABEL: trn2_f32:
 ; CHECK:       // %bb.0:
@@ -2560,36 +2393,6 @@ define <vscale x 16 x i1> @uzp1_nxv16i1(<vscale x 16 x i1> %a, <vscale x 16 x i1
   ret <vscale x 16 x i1> %out
 }
 
-define <vscale x 8 x i1> @uzp1_nxv8i1(<vscale x 8 x i1> %a, <vscale x 8 x i1> %b) {
-; CHECK-LABEL: uzp1_nxv8i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    uzp1 p0.h, p0.h, p1.h
-; CHECK-NEXT:    ret
-  %out = call <vscale x 8 x i1> @llvm.aarch64.sve.uzp1.nxv8i1(<vscale x 8 x i1> %a,
-                                                              <vscale x 8 x i1> %b)
-  ret <vscale x 8 x i1> %out
-}
-
-define <vscale x 4 x i1> @uzp1_nxv4i1(<vscale x 4 x i1> %a, <vscale x 4 x i1> %b) {
-; CHECK-LABEL: uzp1_nxv4i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    uzp1 p0.s, p0.s, p1.s
-; CHECK-NEXT:    ret
-  %out = call <vscale x 4 x i1> @llvm.aarch64.sve.uzp1.nxv4i1(<vscale x 4 x i1> %a,
-                                                              <vscale x 4 x i1> %b)
-  ret <vscale x 4 x i1> %out
-}
-
-define <vscale x 2 x i1> @uzp1_nxv2i1(<vscale x 2 x i1> %a, <vscale x 2 x i1> %b) {
-; CHECK-LABEL: uzp1_nxv2i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    uzp1 p0.d, p0.d, p1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x i1> @llvm.aarch64.sve.uzp1.nxv2i1(<vscale x 2 x i1> %a,
-                                                              <vscale x 2 x i1> %b)
-  ret <vscale x 2 x i1> %out
-}
-
 define <vscale x 16 x i1> @uzp1_b16(<vscale x 16 x i1> %a, <vscale x 16 x i1> %b) {
 ; CHECK-LABEL: uzp1_b16:
 ; CHECK:       // %bb.0:
@@ -2660,26 +2463,6 @@ define <vscale x 2 x i64> @uzp1_i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b
   ret <vscale x 2 x i64> %out
 }
 
-define <vscale x 2 x half> @uzp1_f16_v2(<vscale x 2 x half> %a, <vscale x 2 x half> %b) {
-; CHECK-LABEL: uzp1_f16_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    uzp1 z0.d, z0.d, z1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x half> @llvm.aarch64.sve.uzp1.nxv2f16(<vscale x 2 x half> %a,
-                                                                 <vscale x 2 x half> %b)
-  ret <vscale x 2 x half> %out
-}
-
-define <vscale x 4 x half> @uzp1_f16_v4(<vscale x 4 x half> %a, <vscale x 4 x half> %b) {
-; CHECK-LABEL: uzp1_f16_v4:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    uzp1 z0.s, z0.s, z1.s
-; CHECK-NEXT:    ret
-  %out = call <vscale x 4 x half> @llvm.aarch64.sve.uzp1.nxv4f16(<vscale x 4 x half> %a,
-                                                                 <vscale x 4 x half> %b)
-  ret <vscale x 4 x half> %out
-}
-
 define <vscale x 8 x bfloat> @uzp1_bf16(<vscale x 8 x bfloat> %a, <vscale x 8 x bfloat> %b) #0 {
 ; CHECK-LABEL: uzp1_bf16:
 ; CHECK:       // %bb.0:
@@ -2700,16 +2483,6 @@ define <vscale x 8 x half> @uzp1_f16(<vscale x 8 x half> %a, <vscale x 8 x half>
   ret <vscale x 8 x half> %out
 }
 
-define <vscale x 2 x float> @uzp1_f32_v2(<vscale x 2 x float> %a, <vscale x 2 x float> %b) {
-; CHECK-LABEL: uzp1_f32_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    uzp1 z0.d, z0.d, z1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x float> @llvm.aarch64.sve.uzp1.nxv2f32(<vscale x 2 x float> %a,
-                                                                  <vscale x 2 x float> %b)
-  ret <vscale x 2 x float> %out
-}
-
 define <vscale x 4 x float> @uzp1_f32(<vscale x 4 x float> %a, <vscale x 4 x float> %b) {
 ; CHECK-LABEL: uzp1_f32:
 ; CHECK:       // %bb.0:
@@ -2744,36 +2517,6 @@ define <vscale x 16 x i1> @uzp2_nxv16i1(<vscale x 16 x i1> %a, <vscale x 16 x i1
   ret <vscale x 16 x i1> %out
 }
 
-define <vscale x 8 x i1> @uzp2_nxv8i1(<vscale x 8 x i1> %a, <vscale x 8 x i1> %b) {
-; CHECK-LABEL: uzp2_nxv8i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    uzp2 p0.h, p0.h, p1.h
-; CHECK-NEXT:    ret
-  %out = call <vscale x 8 x i1> @llvm.aarch64.sve.uzp2.nxv8i1(<vscale x 8 x i1> %a,
-                                                              <vscale x 8 x i1> %b)
-  ret <vscale x 8 x i1> %out
-}
-
-define <vscale x 4 x i1> @uzp2_nxv4i1(<vscale x 4 x i1> %a, <vscale x 4 x i1> %b) {
-; CHECK-LABEL: uzp2_nxv4i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    uzp2 p0.s, p0.s, p1.s
-; CHECK-NEXT:    ret
-  %out = call <vscale x 4 x i1> @llvm.aarch64.sve.uzp2.nxv4i1(<vscale x 4 x i1> %a,
-                                                              <vscale x 4 x i1> %b)
-  ret <vscale x 4 x i1> %out
-}
-
-define <vscale x 2 x i1> @uzp2_nxv2i1(<vscale x 2 x i1> %a, <vscale x 2 x i1> %b) {
-; CHECK-LABEL: uzp2_nxv2i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    uzp2 p0.d, p0.d, p1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x i1> @llvm.aarch64.sve.uzp2.nxv2i1(<vscale x 2 x i1> %a,
-                                                              <vscale x 2 x i1> %b)
-  ret <vscale x 2 x i1> %out
-}
-
 define <vscale x 16 x i1> @uzp2_b16(<vscale x 16 x i1> %a, <vscale x 16 x i1> %b) {
 ; CHECK-LABEL: uzp2_b16:
 ; CHECK:       // %bb.0:
@@ -2844,26 +2587,6 @@ define <vscale x 2 x i64> @uzp2_i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b
   ret <vscale x 2 x i64> %out
 }
 
-define <vscale x 2 x half> @uzp2_f16_v2(<vscale x 2 x half> %a, <vscale x 2 x half> %b) {
-; CHECK-LABEL: uzp2_f16_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    uzp2 z0.d, z0.d, z1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x half> @llvm.aarch64.sve.uzp2.nxv2f16(<vscale x 2 x half> %a,
-                                                                 <vscale x 2 x half> %b)
-  ret <vscale x 2 x half> %out
-}
-
-define <vscale x 4 x half> @uzp2_f16_v4(<vscale x 4 x half> %a, <vscale x 4 x half> %b) {
-; CHECK-LABEL: uzp2_f16_v4:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    uzp2 z0.s, z0.s, z1.s
-; CHECK-NEXT:    ret
-  %out = call <vscale x 4 x half> @llvm.aarch64.sve.uzp2.nxv4f16(<vscale x 4 x half> %a,
-                                                                 <vscale x 4 x half> %b)
-  ret <vscale x 4 x half> %out
-}
-
 define <vscale x 8 x bfloat> @uzp2_bf16(<vscale x 8 x bfloat> %a, <vscale x 8 x bfloat> %b) #0 {
 ; CHECK-LABEL: uzp2_bf16:
 ; CHECK:       // %bb.0:
@@ -2884,16 +2607,6 @@ define <vscale x 8 x half> @uzp2_f16(<vscale x 8 x half> %a, <vscale x 8 x half>
   ret <vscale x 8 x half> %out
 }
 
-define <vscale x 2 x float> @uzp2_f32_v2(<vscale x 2 x float> %a, <vscale x 2 x float> %b) {
-; CHECK-LABEL: uzp2_f32_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    uzp2 z0.d, z0.d, z1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x float> @llvm.aarch64.sve.uzp2.nxv2f32(<vscale x 2 x float> %a,
-                                                                  <vscale x 2 x float> %b)
-  ret <vscale x 2 x float> %out
-}
-
 define <vscale x 4 x float> @uzp2_f32(<vscale x 4 x float> %a, <vscale x 4 x float> %b) {
 ; CHECK-LABEL: uzp2_f32:
 ; CHECK:       // %bb.0:
@@ -2928,36 +2641,6 @@ define <vscale x 16 x i1> @zip1_nxv16i1(<vscale x 16 x i1> %a, <vscale x 16 x i1
   ret <vscale x 16 x i1> %out
 }
 
-define <vscale x 8 x i1> @zip1_nxv8i1(<vscale x 8 x i1> %a, <vscale x 8 x i1> %b) {
-; CHECK-LABEL: zip1_nxv8i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    zip1 p0.h, p0.h, p1.h
-; CHECK-NEXT:    ret
-  %out = call <vscale x 8 x i1> @llvm.aarch64.sve.zip1.nxv8i1(<vscale x 8 x i1> %a,
-                                                              <vscale x 8 x i1> %b)
-  ret <vscale x 8 x i1> %out
-}
-
-define <vscale x 4 x i1> @zip1_nxv4i1(<vscale x 4 x i1> %a, <vscale x 4 x i1> %b) {
-; CHECK-LABEL: zip1_nxv4i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    zip1 p0.s, p0.s, p1.s
-; CHECK-NEXT:    ret
-  %out = call <vscale x 4 x i1> @llvm.aarch64.sve.zip1.nxv4i1(<vscale x 4 x i1> %a,
-                                                              <vscale x 4 x i1> %b)
-  ret <vscale x 4 x i1> %out
-}
-
-define <vscale x 2 x i1> @zip1_nxv2i1(<vscale x 2 x i1> %a, <vscale x 2 x i1> %b) {
-; CHECK-LABEL: zip1_nxv2i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    zip1 p0.d, p0.d, p1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x i1> @llvm.aarch64.sve.zip1.nxv2i1(<vscale x 2 x i1> %a,
-                                                              <vscale x 2 x i1> %b)
-  ret <vscale x 2 x i1> %out
-}
-
 define <vscale x 16 x i1> @zip1_b16(<vscale x 16 x i1> %a, <vscale x 16 x i1> %b) {
 ; CHECK-LABEL: zip1_b16:
 ; CHECK:       // %bb.0:
@@ -3028,26 +2711,6 @@ define <vscale x 2 x i64> @zip1_i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b
   ret <vscale x 2 x i64> %out
 }
 
-define <vscale x 2 x half> @zip1_f16_v2(<vscale x 2 x half> %a, <vscale x 2 x half> %b) {
-; CHECK-LABEL: zip1_f16_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    zip1 z0.d, z0.d, z1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x half> @llvm.aarch64.sve.zip1.nxv2f16(<vscale x 2 x half> %a,
-                                                                 <vscale x 2 x half> %b)
-  ret <vscale x 2 x half> %out
-}
-
-define <vscale x 4 x half> @zip1_f16_v4(<vscale x 4 x half> %a, <vscale x 4 x half> %b) {
-; CHECK-LABEL: zip1_f16_v4:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    zip1 z0.s, z0.s, z1.s
-; CHECK-NEXT:    ret
-  %out = call <vscale x 4 x half> @llvm.aarch64.sve.zip1.nxv4f16(<vscale x 4 x half> %a,
-                                                                 <vscale x 4 x half> %b)
-  ret <vscale x 4 x half> %out
-}
-
 define <vscale x 8 x bfloat> @zip1_bf16(<vscale x 8 x bfloat> %a, <vscale x 8 x bfloat> %b) #0 {
 ; CHECK-LABEL: zip1_bf16:
 ; CHECK:       // %bb.0:
@@ -3068,16 +2731,6 @@ define <vscale x 8 x half> @zip1_f16(<vscale x 8 x half> %a, <vscale x 8 x half>
   ret <vscale x 8 x half> %out
 }
 
-define <vscale x 2 x float> @zip1_f32_v2(<vscale x 2 x float> %a, <vscale x 2 x float> %b) {
-; CHECK-LABEL: zip1_f32_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    zip1 z0.d, z0.d, z1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x float> @llvm.aarch64.sve.zip1.nxv2f32(<vscale x 2 x float> %a,
-                                                                  <vscale x 2 x float> %b)
-  ret <vscale x 2 x float> %out
-}
-
 define <vscale x 4 x float> @zip1_f32(<vscale x 4 x float> %a, <vscale x 4 x float> %b) {
 ; CHECK-LABEL: zip1_f32:
 ; CHECK:       // %bb.0:
@@ -3112,36 +2765,6 @@ define <vscale x 16 x i1> @zip2_nxv16i1(<vscale x 16 x i1> %a, <vscale x 16 x i1
   ret <vscale x 16 x i1> %out
 }
 
-define <vscale x 8 x i1> @zip2_nxv8i1(<vscale x 8 x i1> %a, <vscale x 8 x i1> %b) {
-; CHECK-LABEL: zip2_nxv8i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    zip2 p0.h, p0.h, p1.h
-; CHECK-NEXT:    ret
-  %out = call <vscale x 8 x i1> @llvm.aarch64.sve.zip2.nxv8i1(<vscale x 8 x i1> %a,
-                                                              <vscale x 8 x i1> %b)
-  ret <vscale x 8 x i1> %out
-}
-
-define <vscale x 4 x i1> @zip2_nxv4i1(<vscale x 4 x i1> %a, <vscale x 4 x i1> %b) {
-; CHECK-LABEL: zip2_nxv4i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    zip2 p0.s, p0.s, p1.s
-; CHECK-NEXT:    ret
-  %out = call <vscale x 4 x i1> @llvm.aarch64.sve.zip2.nxv4i1(<vscale x 4 x i1> %a,
-                                                              <vscale x 4 x i1> %b)
-  ret <vscale x 4 x i1> %out
-}
-
-define <vscale x 2 x i1> @zip2_nxv2i1(<vscale x 2 x i1> %a, <vscale x 2 x i1> %b) {
-; CHECK-LABEL: zip2_nxv2i1:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    zip2 p0.d, p0.d, p1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x i1> @llvm.aarch64.sve.zip2.nxv2i1(<vscale x 2 x i1> %a,
-                                                              <vscale x 2 x i1> %b)
-  ret <vscale x 2 x i1> %out
-}
-
 define <vscale x 16 x i1> @zip2_b16(<vscale x 16 x i1> %a, <vscale x 16 x i1> %b) {
 ; CHECK-LABEL: zip2_b16:
 ; CHECK:       // %bb.0:
@@ -3212,26 +2835,6 @@ define <vscale x 2 x i64> @zip2_i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %b
   ret <vscale x 2 x i64> %out
 }
 
-define <vscale x 2 x half> @zip2_f16_v2(<vscale x 2 x half> %a, <vscale x 2 x half> %b) {
-; CHECK-LABEL: zip2_f16_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    zip2 z0.d, z0.d, z1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x half> @llvm.aarch64.sve.zip2.nxv2f16(<vscale x 2 x half> %a,
-                                                                 <vscale x 2 x half> %b)
-  ret <vscale x 2 x half> %out
-}
-
-define <vscale x 4 x half> @zip2_f16_v4(<vscale x 4 x half> %a, <vscale x 4 x half> %b) {
-; CHECK-LABEL: zip2_f16_v4:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    zip2 z0.s, z0.s, z1.s
-; CHECK-NEXT:    ret
-  %out = call <vscale x 4 x half> @llvm.aarch64.sve.zip2.nxv4f16(<vscale x 4 x half> %a,
-                                                                 <vscale x 4 x half> %b)
-  ret <vscale x 4 x half> %out
-}
-
 define <vscale x 8 x bfloat> @zip2_bf16(<vscale x 8 x bfloat> %a, <vscale x 8 x bfloat> %b) #0 {
 ; CHECK-LABEL: zip2_bf16:
 ; CHECK:       // %bb.0:
@@ -3252,16 +2855,6 @@ define <vscale x 8 x half> @zip2_f16(<vscale x 8 x half> %a, <vscale x 8 x half>
   ret <vscale x 8 x half> %out
 }
 
-define <vscale x 2 x float> @zip2_f32_v2(<vscale x 2 x float> %a, <vscale x 2 x float> %b) {
-; CHECK-LABEL: zip2_f32_v2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    zip2 z0.d, z0.d, z1.d
-; CHECK-NEXT:    ret
-  %out = call <vscale x 2 x float> @llvm.aarch64.sve.zip2.nxv2f32(<vscale x 2 x float> %a,
-                                                                  <vscale x 2 x float> %b)
-  ret <vscale x 2 x float> %out
-}
-
 define <vscale x 4 x float> @zip2_f32(<vscale x 4 x float> %a, <vscale x 4 x float> %b) {
 ; CHECK-LABEL: zip2_f32:
 ; CHECK:       // %bb.0:
@@ -3347,7 +2940,6 @@ declare i32 @llvm.aarch64.sve.lasta.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32
 declare i64 @llvm.aarch64.sve.lasta.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>)
 declare half @llvm.aarch64.sve.lasta.nxv8f16(<vscale x 8 x i1>, <vscale x 8 x half>)
 declare bfloat @llvm.aarch64.sve.lasta.nxv8bf16(<vscale x 8 x i1>, <vscale x 8 x bfloat>)
-declare float @llvm.aarch64.sve.lasta.nxv2f32(<vscale x 2 x i1>, <vscale x 2 x float>)
 declare float @llvm.aarch64.sve.lasta.nxv4f32(<vscale x 4 x i1>, <vscale x 4 x float>)
 declare double @llvm.aarch64.sve.lasta.nxv2f64(<vscale x 2 x i1>, <vscale x 2 x double>)
 
@@ -3357,14 +2949,10 @@ declare i32 @llvm.aarch64.sve.lastb.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32
 declare i64 @llvm.aarch64.sve.lastb.nxv2i64(<vscale x 2 x i1>, <vscale x 2 x i64>)
 declare half @llvm.aarch64.sve.lastb.nxv8f16(<vscale x 8 x i1>, <vscale x 8 x half>)
 declare bfloat @llvm.aarch64.sve.lastb.nxv8bf16(<vscale x 8 x i1>, <vscale x 8 x bfloat>)
-declare float @llvm.aarch64.sve.lastb.nxv2f32(<vscale x 2 x i1>, <vscale x 2 x float>)
 declare float @llvm.aarch64.sve.lastb.nxv4f32(<vscale x 4 x i1>, <vscale x 4 x float>)
 declare double @llvm.aarch64.sve.lastb.nxv2f64(<vscale x 2 x i1>, <vscale x 2 x double>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.rev.nxv16i1(<vscale x 16 x i1>)
-declare <vscale x 8 x i1> @llvm.aarch64.sve.rev.nxv8i1(<vscale x 8 x i1>)
-declare <vscale x 4 x i1> @llvm.aarch64.sve.rev.nxv4i1(<vscale x 4 x i1>)
-declare <vscale x 2 x i1> @llvm.aarch64.sve.rev.nxv2i1(<vscale x 2 x i1>)
 declare <vscale x 16 x i8> @llvm.aarch64.sve.rev.nxv16i8(<vscale x 16 x i8>)
 declare <vscale x 8 x i16> @llvm.aarch64.sve.rev.nxv8i16(<vscale x 8 x i16>)
 declare <vscale x 4 x i32> @llvm.aarch64.sve.rev.nxv4i32(<vscale x 4 x i32>)
@@ -3413,18 +3001,12 @@ declare <vscale x 4 x i32> @llvm.aarch64.sve.uunpklo.nxv4i32(<vscale x 8 x i16>)
 declare <vscale x 2 x i64> @llvm.aarch64.sve.uunpklo.nxv2i64(<vscale x 4 x i32>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.trn1.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
-declare <vscale x 8 x i1> @llvm.aarch64.sve.trn1.nxv8i1(<vscale x 8 x i1>, <vscale x 8 x i1>)
-declare <vscale x 4 x i1> @llvm.aarch64.sve.trn1.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
-declare <vscale x 2 x i1> @llvm.aarch64.sve.trn1.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>)
 declare <vscale x 16 x i8> @llvm.aarch64.sve.trn1.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
 declare <vscale x 8 x i16> @llvm.aarch64.sve.trn1.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>)
 declare <vscale x 4 x i32> @llvm.aarch64.sve.trn1.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>)
 declare <vscale x 2 x i64> @llvm.aarch64.sve.trn1.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>)
-declare <vscale x 2 x half> @llvm.aarch64.sve.trn1.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>)
-declare <vscale x 4 x half> @llvm.aarch64.sve.trn1.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>)
 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.trn1.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x bfloat>)
 declare <vscale x 8 x half> @llvm.aarch64.sve.trn1.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>)
-declare <vscale x 2 x float> @llvm.aarch64.sve.trn1.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>)
 declare <vscale x 4 x float> @llvm.aarch64.sve.trn1.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>)
 declare <vscale x 2 x double> @llvm.aarch64.sve.trn1.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>)
 
@@ -3433,18 +3015,12 @@ declare <vscale x 16 x i1> @llvm.aarch64.sve.trn1.b32(<vscale x 16 x i1>, <vscal
 declare <vscale x 16 x i1> @llvm.aarch64.sve.trn1.b64(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.trn2.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
-declare <vscale x 8 x i1> @llvm.aarch64.sve.trn2.nxv8i1(<vscale x 8 x i1>, <vscale x 8 x i1>)
-declare <vscale x 4 x i1> @llvm.aarch64.sve.trn2.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
-declare <vscale x 2 x i1> @llvm.aarch64.sve.trn2.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>)
 declare <vscale x 16 x i8> @llvm.aarch64.sve.trn2.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
 declare <vscale x 8 x i16> @llvm.aarch64.sve.trn2.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>)
 declare <vscale x 4 x i32> @llvm.aarch64.sve.trn2.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>)
 declare <vscale x 2 x i64> @llvm.aarch64.sve.trn2.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>)
-declare <vscale x 2 x half> @llvm.aarch64.sve.trn2.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>)
-declare <vscale x 4 x half> @llvm.aarch64.sve.trn2.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>)
 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.trn2.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x bfloat>)
 declare <vscale x 8 x half> @llvm.aarch64.sve.trn2.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>)
-declare <vscale x 2 x float> @llvm.aarch64.sve.trn2.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>)
 declare <vscale x 4 x float> @llvm.aarch64.sve.trn2.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>)
 declare <vscale x 2 x double> @llvm.aarch64.sve.trn2.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>)
 
@@ -3453,18 +3029,12 @@ declare <vscale x 16 x i1> @llvm.aarch64.sve.trn2.b32(<vscale x 16 x i1>, <vscal
 declare <vscale x 16 x i1> @llvm.aarch64.sve.trn2.b64(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.uzp1.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
-declare <vscale x 8 x i1> @llvm.aarch64.sve.uzp1.nxv8i1(<vscale x 8 x i1>, <vscale x 8 x i1>)
-declare <vscale x 4 x i1> @llvm.aarch64.sve.uzp1.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
-declare <vscale x 2 x i1> @llvm.aarch64.sve.uzp1.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>)
 declare <vscale x 16 x i8> @llvm.aarch64.sve.uzp1.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
 declare <vscale x 8 x i16> @llvm.aarch64.sve.uzp1.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>)
 declare <vscale x 4 x i32> @llvm.aarch64.sve.uzp1.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>)
 declare <vscale x 2 x i64> @llvm.aarch64.sve.uzp1.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>)
-declare <vscale x 2 x half> @llvm.aarch64.sve.uzp1.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>)
-declare <vscale x 4 x half> @llvm.aarch64.sve.uzp1.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>)
 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.uzp1.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x bfloat>)
 declare <vscale x 8 x half> @llvm.aarch64.sve.uzp1.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>)
-declare <vscale x 2 x float> @llvm.aarch64.sve.uzp1.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>)
 declare <vscale x 4 x float> @llvm.aarch64.sve.uzp1.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>)
 declare <vscale x 2 x double> @llvm.aarch64.sve.uzp1.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>)
 
@@ -3473,18 +3043,12 @@ declare <vscale x 16 x i1> @llvm.aarch64.sve.uzp1.b32(<vscale x 16 x i1>, <vscal
 declare <vscale x 16 x i1> @llvm.aarch64.sve.uzp1.b64(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.uzp2.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
-declare <vscale x 8 x i1> @llvm.aarch64.sve.uzp2.nxv8i1(<vscale x 8 x i1>, <vscale x 8 x i1>)
-declare <vscale x 4 x i1> @llvm.aarch64.sve.uzp2.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
-declare <vscale x 2 x i1> @llvm.aarch64.sve.uzp2.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>)
 declare <vscale x 16 x i8> @llvm.aarch64.sve.uzp2.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
 declare <vscale x 8 x i16> @llvm.aarch64.sve.uzp2.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>)
 declare <vscale x 4 x i32> @llvm.aarch64.sve.uzp2.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>)
 declare <vscale x 2 x i64> @llvm.aarch64.sve.uzp2.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>)
-declare <vscale x 2 x half> @llvm.aarch64.sve.uzp2.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>)
-declare <vscale x 4 x half> @llvm.aarch64.sve.uzp2.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>)
 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.uzp2.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x bfloat>)
 declare <vscale x 8 x half> @llvm.aarch64.sve.uzp2.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>)
-declare <vscale x 2 x float> @llvm.aarch64.sve.uzp2.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>)
 declare <vscale x 4 x float> @llvm.aarch64.sve.uzp2.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>)
 declare <vscale x 2 x double> @llvm.aarch64.sve.uzp2.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>)
 
@@ -3493,18 +3057,12 @@ declare <vscale x 16 x i1> @llvm.aarch64.sve.uzp2.b32(<vscale x 16 x i1>, <vscal
 declare <vscale x 16 x i1> @llvm.aarch64.sve.uzp2.b64(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.zip1.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
-declare <vscale x 8 x i1> @llvm.aarch64.sve.zip1.nxv8i1(<vscale x 8 x i1>, <vscale x 8 x i1>)
-declare <vscale x 4 x i1> @llvm.aarch64.sve.zip1.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
-declare <vscale x 2 x i1> @llvm.aarch64.sve.zip1.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>)
 declare <vscale x 16 x i8> @llvm.aarch64.sve.zip1.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
 declare <vscale x 8 x i16> @llvm.aarch64.sve.zip1.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>)
 declare <vscale x 4 x i32> @llvm.aarch64.sve.zip1.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>)
 declare <vscale x 2 x i64> @llvm.aarch64.sve.zip1.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>)
-declare <vscale x 2 x half> @llvm.aarch64.sve.zip1.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>)
-declare <vscale x 4 x half> @llvm.aarch64.sve.zip1.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>)
 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.zip1.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x bfloat>)
 declare <vscale x 8 x half> @llvm.aarch64.sve.zip1.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>)
-declare <vscale x 2 x float> @llvm.aarch64.sve.zip1.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>)
 declare <vscale x 4 x float> @llvm.aarch64.sve.zip1.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>)
 declare <vscale x 2 x double> @llvm.aarch64.sve.zip1.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>)
 
@@ -3513,18 +3071,12 @@ declare <vscale x 16 x i1> @llvm.aarch64.sve.zip1.b32(<vscale x 16 x i1>, <vscal
 declare <vscale x 16 x i1> @llvm.aarch64.sve.zip1.b64(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.zip2.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
-declare <vscale x 8 x i1> @llvm.aarch64.sve.zip2.nxv8i1(<vscale x 8 x i1>, <vscale x 8 x i1>)
-declare <vscale x 4 x i1> @llvm.aarch64.sve.zip2.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
-declare <vscale x 2 x i1> @llvm.aarch64.sve.zip2.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>)
 declare <vscale x 16 x i8> @llvm.aarch64.sve.zip2.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
 declare <vscale x 8 x i16> @llvm.aarch64.sve.zip2.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>)
 declare <vscale x 4 x i32> @llvm.aarch64.sve.zip2.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>)
 declare <vscale x 2 x i64> @llvm.aarch64.sve.zip2.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>)
-declare <vscale x 2 x half> @llvm.aarch64.sve.zip2.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>)
-declare <vscale x 4 x half> @llvm.aarch64.sve.zip2.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>)
 declare <vscale x 8 x bfloat> @llvm.aarch64.sve.zip2.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x bfloat>)
 declare <vscale x 8 x half> @llvm.aarch64.sve.zip2.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>)
-declare <vscale x 2 x float> @llvm.aarch64.sve.zip2.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>)
 declare <vscale x 4 x float> @llvm.aarch64.sve.zip2.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>)
 declare <vscale x 2 x double> @llvm.aarch64.sve.zip2.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>)
 
diff --git a/llvm/test/CodeGen/AArch64/sve-intrinsics-pred-operations.ll b/llvm/test/CodeGen/AArch64/sve-intrinsics-pred-operations.ll
index 8a0403c59732a3..00e198bf168b21 100644
--- a/llvm/test/CodeGen/AArch64/sve-intrinsics-pred-operations.ll
+++ b/llvm/test/CodeGen/AArch64/sve-intrinsics-pred-operations.ll
@@ -279,24 +279,6 @@ define <vscale x 8 x i1> @punpkhi_b16(<vscale x 16 x i1> %a) {
   ret <vscale x 8 x i1> %res
 }
 
-define <vscale x 4 x i1> @punpkhi_b8(<vscale x 8 x i1> %a) {
-; CHECK-LABEL: punpkhi_b8:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    punpkhi p0.h, p0.b
-; CHECK-NEXT:    ret
-  %res = call <vscale x 4 x i1> @llvm.aarch64.sve.punpkhi.nxv4i1(<vscale x 8 x i1> %a)
-  ret <vscale x 4 x i1> %res
-}
-
-define <vscale x 2 x i1> @punpkhi_b4(<vscale x 4 x i1> %a) {
-; CHECK-LABEL: punpkhi_b4:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    punpkhi p0.h, p0.b
-; CHECK-NEXT:    ret
-  %res = call <vscale x 2 x i1> @llvm.aarch64.sve.punpkhi.nxv2i1(<vscale x 4 x i1> %a)
-  ret <vscale x 2 x i1> %res
-}
-
 ;
 ; PUNPKLO
 ;
@@ -309,22 +291,3 @@ define <vscale x 8 x i1> @punpklo_b16(<vscale x 16 x i1> %a) {
   %res = call <vscale x 8 x i1> @llvm.aarch64.sve.punpklo.nxv8i1(<vscale x 16 x i1> %a)
   ret <vscale x 8 x i1> %res
 }
-
-define <vscale x 4 x i1> @punpklo_b8(<vscale x 8 x i1> %a) {
-; CHECK-LABEL: punpklo_b8:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    punpklo p0.h, p0.b
-; CHECK-NEXT:    ret
-  %res = call <vscale x 4 x i1> @llvm.aarch64.sve.punpklo.nxv4i1(<vscale x 8 x i1> %a)
-  ret <vscale x 4 x i1> %res
-}
-
-define <vscale x 2 x i1> @punpklo_b4(<vscale x 4 x i1> %a) {
-; CHECK-LABEL: punpklo_b4:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    punpklo p0.h, p0.b
-; CHECK-NEXT:    ret
-  %res = call <vscale x 2 x i1> @llvm.aarch64.sve.punpklo.nxv2i1(<vscale x 4 x i1> %a)
-  ret <vscale x 2 x i1> %res
-}
-
diff --git a/llvm/test/CodeGen/AArch64/sve-intrinsics-reinterpret.ll b/llvm/test/CodeGen/AArch64/sve-intrinsics-reinterpret.ll
index 366ec95ebc6585..dea0c136dbc135 100644
--- a/llvm/test/CodeGen/AArch64/sve-intrinsics-reinterpret.ll
+++ b/llvm/test/CodeGen/AArch64/sve-intrinsics-reinterpret.ll
@@ -126,7 +126,7 @@ define <vscale x 16 x i1> @reinterpret_ptrue() {
   ret <vscale x 16 x i1> %out
 }
 
-; Reinterpreting a comparison not introduce an `and` instruction.
+; Reinterpreting a comparison should not introduce an `and` instruction.
 define <vscale x 16 x i1> @reinterpret_cmpgt(<vscale x 8 x i1> %p, <vscale x 8 x i16> %a, <vscale x 8 x i16> %b) {
 ; CHECK-LABEL: reinterpret_cmpgt:
 ; CHECK:       // %bb.0:
@@ -137,6 +137,28 @@ define <vscale x 16 x i1> @reinterpret_cmpgt(<vscale x 8 x i1> %p, <vscale x 8 x
   ret <vscale x 16 x i1> %2
 }
 
+; These FP comparisons remain intrinsic DAG nodes when the predicate is
+; converted, so isZeroingInactiveLanes must recognize their zeroing behavior.
+define <vscale x 16 x i1> @reinterpret_facgt(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
+; CHECK-LABEL: reinterpret_facgt:
+; CHECK:       // %bb.0:
+; CHECK-NEXT:    facgt p0.s, p0/z, z0.s, z1.s
+; CHECK-NEXT:    ret
+  %cmp = call <vscale x 4 x i1> @llvm.aarch64.sve.facgt.nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
+  %out = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %cmp)
+  ret <vscale x 16 x i1> %out
+}
+
+define <vscale x 16 x i1> @reinterpret_facge(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
+; CHECK-LABEL: reinterpret_facge:
+; CHECK:       // %bb.0:
+; CHECK-NEXT:    facge p0.s, p0/z, z0.s, z1.s
+; CHECK-NEXT:    ret
+  %cmp = call <vscale x 4 x i1> @llvm.aarch64.sve.facge.nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
+  %out = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %cmp)
+  ret <vscale x 16 x i1> %out
+}
+
 ; The first reinterpret should prevent the second one from being simplified as a nop
 define <vscale x 16 x i1> @chained_reinterpret() {
 ; CHECK-LABEL: chained_reinterpret:
diff --git a/llvm/test/CodeGen/AArch64/sve-ld1r.ll b/llvm/test/CodeGen/AArch64/sve-ld1r.ll
index a6d7d17fd9eef3..520f651078409e 100644
--- a/llvm/test/CodeGen/AArch64/sve-ld1r.ll
+++ b/llvm/test/CodeGen/AArch64/sve-ld1r.ll
@@ -1191,21 +1191,6 @@ define <vscale x 2 x double> @dup_ld1rd_double_passthruundef_nxv2f64(<vscale x 2
     %res = call <vscale x 2 x double> @llvm.aarch64.sve.dup.nxv2f64(<vscale x 2 x double> poison, <vscale x 2 x i1> %pg, double %ld)
     ret <vscale x 2 x double> %res
 }
-define <vscale x 4 x half> @dup_ld1rh_half_passthruundef_nxv4f16(<vscale x 4 x i1> %pg, ptr %addr) {
-; CHECK-LD1R-LABEL: dup_ld1rh_half_passthruundef_nxv4f16:
-; CHECK-LD1R:       // %bb.0:
-; CHECK-LD1R-NEXT:    ld1rh { z0.s }, p0/z, [x0]
-; CHECK-LD1R-NEXT:    ret
-;
-; CHECK-NO-LD1R-LABEL: dup_ld1rh_half_passthruundef_nxv4f16:
-; CHECK-NO-LD1R:       // %bb.0:
-; CHECK-NO-LD1R-NEXT:    ldr h0, [x0]
-; CHECK-NO-LD1R-NEXT:    mov z0.h, p0/m, h0
-; CHECK-NO-LD1R-NEXT:    ret
-    %ld = load half, ptr %addr
-    %res = call <vscale x 4 x half> @llvm.aarch64.sve.dup.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, half %ld)
-    ret <vscale x 4 x half> %res
-}
 define <vscale x 16 x i8> @dup_ld1rb_i8_passthruzero_nxv16i8(<vscale x 16 x i1> %pg, ptr %addr) {
 ; CHECK-LABEL: dup_ld1rb_i8_passthruzero_nxv16i8:
 ; CHECK:       // %bb.0:
@@ -1290,54 +1275,6 @@ define <vscale x 2 x double> @dup_ld1rd_double_passthruzero_nxv2f64(<vscale x 2
     %res = call <vscale x 2 x double> @llvm.aarch64.sve.dup.nxv2f64(<vscale x 2 x double> zeroinitializer, <vscale x 2 x i1> %pg, double %ld)
     ret <vscale x 2 x double> %res
 }
-define <vscale x 4 x half> @dup_ld1rh_half_passthruzero_nxv4f16(<vscale x 4 x i1> %pg, ptr %addr) {
-; CHECK-LD1R-LABEL: dup_ld1rh_half_passthruzero_nxv4f16:
-; CHECK-LD1R:       // %bb.0:
-; CHECK-LD1R-NEXT:    ld1rh { z0.s }, p0/z, [x0]
-; CHECK-LD1R-NEXT:    ret
-;
-; CHECK-NO-LD1R-LABEL: dup_ld1rh_half_passthruzero_nxv4f16:
-; CHECK-NO-LD1R:       // %bb.0:
-; CHECK-NO-LD1R-NEXT:    movi v0.2d, #0000000000000000
-; CHECK-NO-LD1R-NEXT:    ldr h1, [x0]
-; CHECK-NO-LD1R-NEXT:    mov z0.h, p0/m, h1
-; CHECK-NO-LD1R-NEXT:    ret
-    %ld = load half, ptr %addr
-    %res = call <vscale x 4 x half> @llvm.aarch64.sve.dup.nxv4f16(<vscale x 4 x half> zeroinitializer, <vscale x 4 x i1> %pg, half %ld)
-    ret <vscale x 4 x half> %res
-}
-define <vscale x 2 x half> @dup_ld1rh_half_passthruzero_nxv2f16(<vscale x 2 x i1> %pg, ptr %addr) {
-; CHECK-LD1R-LABEL: dup_ld1rh_half_passthruzero_nxv2f16:
-; CHECK-LD1R:       // %bb.0:
-; CHECK-LD1R-NEXT:    ld1rh { z0.d }, p0/z, [x0]
-; CHECK-LD1R-NEXT:    ret
-;
-; CHECK-NO-LD1R-LABEL: dup_ld1rh_half_passthruzero_nxv2f16:
-; CHECK-NO-LD1R:       // %bb.0:
-; CHECK-NO-LD1R-NEXT:    movi v0.2d, #0000000000000000
-; CHECK-NO-LD1R-NEXT:    ldr h1, [x0]
-; CHECK-NO-LD1R-NEXT:    mov z0.h, p0/m, h1
-; CHECK-NO-LD1R-NEXT:    ret
-    %ld = load half, ptr %addr
-    %res = call <vscale x 2 x half> @llvm.aarch64.sve.dup.nxv2f16(<vscale x 2 x half> zeroinitializer, <vscale x 2 x i1> %pg, half %ld)
-    ret <vscale x 2 x half> %res
-}
-define <vscale x 2 x float> @dup_ld1rs_float_passthruzero_nxv2f32(<vscale x 2 x i1> %pg, ptr %addr) {
-; CHECK-LD1R-LABEL: dup_ld1rs_float_passthruzero_nxv2f32:
-; CHECK-LD1R:       // %bb.0:
-; CHECK-LD1R-NEXT:    ld1rw { z0.d }, p0/z, [x0]
-; CHECK-LD1R-NEXT:    ret
-;
-; CHECK-NO-LD1R-LABEL: dup_ld1rs_float_passthruzero_nxv2f32:
-; CHECK-NO-LD1R:       // %bb.0:
-; CHECK-NO-LD1R-NEXT:    movi v0.2d, #0000000000000000
-; CHECK-NO-LD1R-NEXT:    ldr s1, [x0]
-; CHECK-NO-LD1R-NEXT:    mov z0.s, p0/m, s1
-; CHECK-NO-LD1R-NEXT:    ret
-    %ld = load float, ptr %addr
-    %res = call <vscale x 2 x float> @llvm.aarch64.sve.dup.nxv2f32(<vscale x 2 x float> zeroinitializer, <vscale x 2 x i1> %pg, float %ld)
-    ret <vscale x 2 x float> %res
-}
 define <vscale x 16 x i8> @negtest_dup_ld1rb_i8_passthru_nxv16i8(<vscale x 16 x i8> %pt, <vscale x 16 x i1> %pg, ptr %addr) {
 ; CHECK-LABEL: negtest_dup_ld1rb_i8_passthru_nxv16i8:
 ; CHECK:       // %bb.0:
diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpeq.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpeq.ll
index 8a8588ce4e1cbe..d0b7377f4948e3 100644
--- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpeq.ll
+++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpeq.ll
@@ -17,18 +17,6 @@ define i32 @cmpeq_nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale
   ret i32 %conv
 }
 
-define i32 @cmpeq_nxv4i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmpeq_nxv4i32:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    cmpeq p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpeq.nxv4i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %1)
-  %conv = zext i1 %2 to i32
-  ret i32 %conv
-}
-
 ;
 ; Immediate Compares
 ;
@@ -95,7 +83,6 @@ declare <vscale x 16 x i1> @llvm.aarch64.sve.cmpeq.wide.nxv16i8(<vscale x 16 x i
 declare <vscale x 8 x i1> @llvm.aarch64.sve.cmpeq.wide.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>, <vscale x 2 x i64>)
 declare <vscale x 4 x i1> @llvm.aarch64.sve.cmpeq.wide.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, <vscale x 2 x i64>)
 
-declare i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
 declare i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32)
diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpge.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpge.ll
index ae0369988e7cd4..ad50d145c3b081 100644
--- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpge.ll
+++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpge.ll
@@ -17,18 +17,6 @@ define i32 @cmpge_nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale
   ret i32 %conv
 }
 
-define i32 @cmpge_nxv4i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmpge_nxv4i32:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    cmpge p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %1)
-  %conv = zext i1 %2 to i32
-  ret i32 %conv
-}
-
 ;
 ; Immediate Compares
 ;
@@ -95,7 +83,6 @@ declare <vscale x 16 x i1> @llvm.aarch64.sve.cmpge.wide.nxv16i8(<vscale x 16 x i
 declare <vscale x 8 x i1> @llvm.aarch64.sve.cmpge.wide.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>, <vscale x 2 x i64>)
 declare <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.wide.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, <vscale x 2 x i64>)
 
-declare i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
 declare i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32)
diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpgt.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpgt.ll
index a9b9f5134a6d24..ac976b1e2b0b79 100644
--- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpgt.ll
+++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpgt.ll
@@ -17,18 +17,6 @@ define i32 @cmpgt_nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale
   ret i32 %conv
 }
 
-define i32 @cmpgt_nxv4i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmpgt_nxv4i32:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    cmpgt p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpgt.nxv4i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %1)
-  %conv = zext i1 %2 to i32
-  ret i32 %conv
-}
-
 ;
 ; Immediate Compares
 ;
@@ -95,7 +83,6 @@ declare <vscale x 16 x i1> @llvm.aarch64.sve.cmpgt.wide.nxv16i8(<vscale x 16 x i
 declare <vscale x 8 x i1> @llvm.aarch64.sve.cmpgt.wide.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>, <vscale x 2 x i64>)
 declare <vscale x 4 x i1> @llvm.aarch64.sve.cmpgt.wide.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, <vscale x 2 x i64>)
 
-declare i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
 declare i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32)
diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphi.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphi.ll
index d5c547888f72d9..0556a362922ab5 100644
--- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphi.ll
+++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphi.ll
@@ -17,19 +17,6 @@ define i32 @cmphi_nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale
   ret i32 %conv
 }
 
-define i32 @cmphi_nxv4i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmphi_nxv4i32:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    cmphi p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmphi.nxv4i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %1)
-  %conv = zext i1 %2 to i32
-  ret i32 %conv
-}
-
-
 ;
 ; Immediate Compares
 ;
@@ -96,7 +83,6 @@ declare <vscale x 16 x i1> @llvm.aarch64.sve.cmphi.wide.nxv16i8(<vscale x 16 x i
 declare <vscale x 8 x i1> @llvm.aarch64.sve.cmphi.wide.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>, <vscale x 2 x i64>)
 declare <vscale x 4 x i1> @llvm.aarch64.sve.cmphi.wide.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, <vscale x 2 x i64>)
 
-declare i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
 declare i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32)
diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphs.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphs.ll
index 9a2c7597db6324..1e772e84c4773c 100644
--- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphs.ll
+++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphs.ll
@@ -17,18 +17,6 @@ define i32 @cmphs_nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale
   ret i32 %conv
 }
 
-define i32 @cmphs_nxv4i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmphs_nxv4i32:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    cmphs p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmphs.nxv4i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %1)
-  %conv = zext i1 %2 to i32
-  ret i32 %conv
-}
-
 ;
 ; Immediate Compares
 ;
@@ -95,7 +83,6 @@ declare <vscale x 16 x i1> @llvm.aarch64.sve.cmphs.wide.nxv16i8(<vscale x 16 x i
 declare <vscale x 8 x i1> @llvm.aarch64.sve.cmphs.wide.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>, <vscale x 2 x i64>)
 declare <vscale x 4 x i1> @llvm.aarch64.sve.cmphs.wide.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, <vscale x 2 x i64>)
 
-declare i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
 declare i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32)
diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmple.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmple.ll
index 88a764dcb2fcdb..06ffe07063f3ee 100644
--- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmple.ll
+++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmple.ll
@@ -260,52 +260,6 @@ define i1 @cmp8_ptest_any_xx(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vsc
 }
 
 ;
-; PTEST_FIRST(X=CMP32(PG, A, B), X). PTEST is redundant if condition is changed
-; to any.
-;
-define i1 @cmp32_ptest_first_xx(<vscale x 16 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmp32_ptest_first_xx:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    cmpge p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
-  %2 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1> %1, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %3 = tail call i1 @llvm.aarch64.sve.ptest.first.nxv4i1(<vscale x 4 x i1> %2, <vscale x 4 x i1> %2)
-  ret i1 %3
-}
-
-;
-; PTEST_LAST(X=CMP32(PG, A, B), X). PTEST is redundant if condition is changed
-; to any.
-;
-define i1 @cmp32_ptest_last_xx(<vscale x 16 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmp32_ptest_last_xx:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    cmpge p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
-  %2 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1> %1, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %3 = tail call i1 @llvm.aarch64.sve.ptest.last.nxv4i1(<vscale x 4 x i1> %2, <vscale x 4 x i1> %2)
-  ret i1 %3
-}
-
-;
-; PTEST_ANY(X=CMP32(PG, A, B), X). PTEST is redundant.
-;
-define i1 @cmp32_ptest_any_xx(<vscale x 16 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmp32_ptest_any_xx:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    cmpge p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
-  %2 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1> %1, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %3 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %2, <vscale x 4 x i1> %2)
-  ret i1 %3
-}
-
 ; ==============================================================================
 ; PTEST_OP(PTRUE_ALL, CMP(PG, ...))
 ; ==============================================================================
@@ -358,57 +312,6 @@ define i1 @cmp8_ptest_any_ax(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vsc
   ret i1 %3
 }
 
-;
-; PTEST_FIRST(PTRUE_ALL, CMP32(PG, A, B)). Can't remove PTEST since mask is
-; different.
-;
-define i1 @cmp32_ptest_first_ax(<vscale x 16 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmp32_ptest_first_ax:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    cmpge p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    ptest p0, p1.b
-; CHECK-NEXT:    cset w0, mi
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
-  %2 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1> %1, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %4 = tail call i1 @llvm.aarch64.sve.ptest.first.nxv4i1(<vscale x 4 x i1> splat (i1 true), <vscale x 4 x i1> %2)
-  ret i1 %4
-}
-
-;
-; PTEST_LAST(PTRUE_ALL, CMP32(PG, A, B)). Can't remove PTEST since mask is
-; different.
-;
-define i1 @cmp32_ptest_last_ax(<vscale x 16 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmp32_ptest_last_ax:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    cmpge p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    ptest p0, p1.b
-; CHECK-NEXT:    cset w0, lo
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
-  %2 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1> %1, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %4 = tail call i1 @llvm.aarch64.sve.ptest.last.nxv4i1(<vscale x 4 x i1> splat (i1 true), <vscale x 4 x i1> %2)
-  ret i1 %4
-}
-
-;
-; PTEST_ANY(PTRUE_ALL, CMP32(PG, A, B)). PTEST is redundant.
-;
-define i1 @cmp32_ptest_any_ax(<vscale x 16 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmp32_ptest_any_ax:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    cmpge p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
-  %2 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1> %1, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %4 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> splat (i1 true), <vscale x 4 x i1> %2)
-  ret i1 %4
-}
-
 ; ==============================================================================
 ; PTEST_OP(PTRUE_ALL, CMP(PTRUE_ALL, ...))
 ; ==============================================================================
@@ -458,51 +361,6 @@ define i1 @cmp8_ptest_any_aa(<vscale x 16 x i8> %a, <vscale x 16 x i8> %b) {
   ret i1 %3
 }
 
-;
-; PTEST_FIRST(PTRUE_ALL, CMP32(PTRUE_ALL, A, B)). PTEST is redundant.
-;
-define i1 @cmp32_ptest_first_aa(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmp32_ptest_first_aa:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    cmpge p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, mi
-; CHECK-NEXT:    ret
-  %2 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1> splat (i1 true), <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %3 = tail call i1 @llvm.aarch64.sve.ptest.first.nxv4i1(<vscale x 4 x i1> splat (i1 true), <vscale x 4 x i1> %2)
-  ret i1 %3
-}
-
-;
-; PTEST_LAST(PTRUE_ALL, CMP32(PTRUE_ALL, A, B)). PTEST is redundant.
-;
-define i1 @cmp32_ptest_last_aa(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmp32_ptest_last_aa:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    cmpge p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, lo
-; CHECK-NEXT:    ret
-  %2 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1> splat (i1 true), <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %3 = tail call i1 @llvm.aarch64.sve.ptest.last.nxv4i1(<vscale x 4 x i1> splat (i1 true), <vscale x 4 x i1> %2)
-  ret i1 %3
-}
-
-;
-; PTEST_ANY(PTRUE_ALL, CMP32(PTRUE_ALL, A, B)). PTEST is redundant.
-;
-define i1 @cmp32_ptest_any_aa(<vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmp32_ptest_any_aa:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    cmpge p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %2 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1> splat (i1 true), <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %3 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> splat (i1 true), <vscale x 4 x i1> %2)
-  ret i1 %3
-}
-
 declare <vscale x 16 x i1> @llvm.aarch64.sve.cmpge.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>, <vscale x 16 x i8>)
 declare <vscale x 4 x i1> @llvm.aarch64.sve.cmpge.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, <vscale x 4 x i32>)
 declare <vscale x 16 x i1> @llvm.aarch64.sve.cmple.wide.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>, <vscale x 2 x i64>)
@@ -513,10 +371,6 @@ declare i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1>, <vscale x 16
 declare i1 @llvm.aarch64.sve.ptest.first.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
 declare i1 @llvm.aarch64.sve.ptest.last.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
-declare i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
-declare i1 @llvm.aarch64.sve.ptest.first.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
-declare i1 @llvm.aarch64.sve.ptest.last.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
-
 declare <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1>)
 declare <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1>)
 
diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpne.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpne.ll
index 82987b84b5e3ca..2820ec4c6a54b2 100644
--- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpne.ll
+++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpne.ll
@@ -17,18 +17,6 @@ define i32 @cmpne_nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale
   ret i32 %conv
 }
 
-define i32 @cmpne_nxv4i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b) {
-; CHECK-LABEL: cmpne_nxv4i32:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    cmpne p1.s, p0/z, z0.s, z1.s
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.cmpne.nxv4i32(<vscale x 4 x i1> %pg, <vscale x 4 x i32> %a, <vscale x 4 x i32> %b)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %1)
-  %conv = zext i1 %2 to i32
-  ret i32 %conv
-}
-
 ;
 ; Immediate Compares
 ;
@@ -95,7 +83,6 @@ declare <vscale x 16 x i1> @llvm.aarch64.sve.cmpne.wide.nxv16i8(<vscale x 16 x i
 declare <vscale x 8 x i1> @llvm.aarch64.sve.cmpne.wide.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>, <vscale x 2 x i64>)
 declare <vscale x 4 x i1> @llvm.aarch64.sve.cmpne.wide.nxv4i32(<vscale x 4 x i1>, <vscale x 4 x i32>, <vscale x 2 x i64>)
 
-declare i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
 declare i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32)
diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-pfirst-pnext.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-pfirst-pnext.ll
index 55af332eacf9a9..e72ef6e29b1ce4 100644
--- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-pfirst-pnext.ll
+++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-pfirst-pnext.ll
@@ -13,42 +13,6 @@ define i32 @pfirst_16(<vscale x 16 x i1> %pg, <vscale x 16 x i1> %a) {
   ret i32 %conv
 }
 
-define i32 @pnext_2(<vscale x 2 x i1> %pg, <vscale x 2 x i1> %a) {
-; CHECK-LABEL: pnext_2:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    pnext p1.d, p0, p1.d
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 2 x i1> @llvm.aarch64.sve.pnext.nxv2i1(<vscale x 2 x i1> %pg, <vscale x 2 x i1> %a)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv2i1(<vscale x 2 x i1> %pg, <vscale x 2 x i1> %1)
-  %conv = zext i1 %2 to i32
-  ret i32 %conv
-}
-
-define i32 @pnext_4(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %a) {
-; CHECK-LABEL: pnext_4:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    pnext p1.s, p0, p1.s
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.pnext.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %a)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %1)
-  %conv = zext i1 %2 to i32
-  ret i32 %conv
-}
-
-define i32 @pnext_8(<vscale x 8 x i1> %pg, <vscale x 8 x i1> %a) {
-; CHECK-LABEL: pnext_8:
-; CHECK:       // %bb.0:
-; CHECK-NEXT:    pnext p1.h, p0, p1.h
-; CHECK-NEXT:    cset w0, ne
-; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 8 x i1> @llvm.aarch64.sve.pnext.nxv8i1(<vscale x 8 x i1> %pg, <vscale x 8 x i1> %a)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv8i1(<vscale x 8 x i1> %pg, <vscale x 8 x i1> %1)
-  %conv = zext i1 %2 to i32
-  ret i32 %conv
-}
-
 define i32 @pnext_16(<vscale x 16 x i1> %pg, <vscale x 16 x i1> %a) {
 ; CHECK-LABEL: pnext_16:
 ; CHECK:       // %bb.0:
@@ -64,11 +28,5 @@ define i32 @pnext_16(<vscale x 16 x i1> %pg, <vscale x 16 x i1> %a) {
 declare <vscale x 16 x i1> @llvm.aarch64.sve.pfirst.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.pnext.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
-declare <vscale x 8 x i1> @llvm.aarch64.sve.pnext.nxv8i1(<vscale x 8 x i1>, <vscale x 8 x i1>)
-declare <vscale x 4 x i1> @llvm.aarch64.sve.pnext.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
-declare <vscale x 2 x i1> @llvm.aarch64.sve.pnext.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>)
 
 declare i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
-declare i1 @llvm.aarch64.sve.ptest.any.nxv8i1(<vscale x 8 x i1>, <vscale x 8 x i1>)
-declare i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
-declare i1 @llvm.aarch64.sve.ptest.any.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>)
diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-sink.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-sink.ll
index 39fe92aae06199..6a81362b30c7f7 100644
--- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-sink.ll
+++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-sink.ll
@@ -3,6 +3,8 @@
 
 ;
 ; Ensure that the %ptrue from the preheader is sunk into the loop such that the ptest is removed.
+; PTEST_FIRST tests the first lane, so the all-active byte predicate is equivalent
+; to the all-active word predicate for the converted WHILELT result.
 ;
 
 define void @test_sink_ptrue_into_ptest(i32 %n) {
@@ -23,16 +25,18 @@ define void @test_sink_ptrue_into_ptest(i32 %n) {
 entry:
   %vscale = tail call i32 @llvm.vscale.i32()
   %step = shl nuw nsw i32 %vscale, 2
-  %ptrue.ph = tail call <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32 31)
+  %ptrue.ph = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 31)
   %while.ph = tail call <vscale x 4 x i1> @llvm.aarch64.sve.whilelt.nxv4i1.i32(i32 0, i32 %n)
-  %ptest.ph = tail call i1 @llvm.aarch64.sve.ptest.first.nxv4i1(<vscale x 4 x i1> %ptrue.ph, <vscale x 4 x i1> %while.ph)
+  %while.ph.svbool = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %while.ph)
+  %ptest.ph = tail call i1 @llvm.aarch64.sve.ptest.first.nxv16i1(<vscale x 16 x i1> %ptrue.ph, <vscale x 16 x i1> %while.ph.svbool)
   br i1 %ptest.ph, label %for.body, label %exit
 
 for.body:
   %i = phi i32 [ 0, %entry ], [ %i.next, %for.body ]
   %i.next = add i32 %i, %step
   %while = call <vscale x 4 x i1> @llvm.aarch64.sve.whilelt.nxv4i1.i32(i32 %i, i32 %n)
-  %ptest = call i1 @llvm.aarch64.sve.ptest.first.nxv4i1(<vscale x 4 x i1> %ptrue.ph, <vscale x 4 x i1> %while)
+  %while.svbool = call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %while)
+  %ptest = call i1 @llvm.aarch64.sve.ptest.first.nxv16i1(<vscale x 16 x i1> %ptrue.ph, <vscale x 16 x i1> %while.svbool)
   br i1 %ptest, label %for.body, label %exit
 
 exit:
@@ -40,6 +44,7 @@ exit:
 }
 
 declare i32 @llvm.vscale.i32()
-declare <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32 immarg)
+declare <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 immarg)
 declare <vscale x 4 x i1> @llvm.aarch64.sve.whilelt.nxv4i1.i32(i32, i32)
-declare i1 @llvm.aarch64.sve.ptest.first.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
+declare <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1>)
+declare i1 @llvm.aarch64.sve.ptest.first.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
diff --git a/llvm/test/CodeGen/AArch64/sve-ptest.ll b/llvm/test/CodeGen/AArch64/sve-ptest.ll
index fa50810cfed375..c9d9c35094e218 100644
--- a/llvm/test/CodeGen/AArch64/sve-ptest.ll
+++ b/llvm/test/CodeGen/AArch64/sve-ptest.ll
@@ -1,71 +1,83 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: opt -passes=verify -disable-output %s
 ; RUN: llc -mtriple=aarch64--linux-gnu -mattr=+sve %s -o - | FileCheck %s
 
 
-; Ensure that the inactive lanes of p1 aren't zeroed, since the FP compare should do that for free.
+; FP compare intrinsics are combined into SETCC_MERGE_ZERO. Check that
+; converting their results to svbool needs no inactive-lane mask before ptest.
 
-define i32 @fcmpeq_nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
+define i32 @fcmpeq_nxv4f32(<vscale x 16 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
 ; CHECK-LABEL: fcmpeq_nxv4f32:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    fcmeq p1.s, p0/z, z0.s, z1.s
 ; CHECK-NEXT:    ptest p0, p1.b
 ; CHECK-NEXT:    cset w0, ne
 ; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpeq.nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %1)
-  %conv = zext i1 %2 to i32
+  %pg4 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
+  %cmp = tail call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpeq.nxv4f32(<vscale x 4 x i1> %pg4, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
+  %cmp16 = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %cmp)
+  %any = tail call i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1> %pg, <vscale x 16 x i1> %cmp16)
+  %conv = zext i1 %any to i32
   ret i32 %conv
 }
 
-define i32 @fcmpne_nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
+define i32 @fcmpne_nxv4f32(<vscale x 16 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
 ; CHECK-LABEL: fcmpne_nxv4f32:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    fcmne p1.s, p0/z, z0.s, z1.s
 ; CHECK-NEXT:    ptest p0, p1.b
 ; CHECK-NEXT:    cset w0, ne
 ; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpne.nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %1)
-  %conv = zext i1 %2 to i32
+  %pg4 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
+  %cmp = tail call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpne.nxv4f32(<vscale x 4 x i1> %pg4, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
+  %cmp16 = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %cmp)
+  %any = tail call i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1> %pg, <vscale x 16 x i1> %cmp16)
+  %conv = zext i1 %any to i32
   ret i32 %conv
 }
 
-define i32 @fcmpge_nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
+define i32 @fcmpge_nxv4f32(<vscale x 16 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
 ; CHECK-LABEL: fcmpge_nxv4f32:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    fcmge p1.s, p0/z, z0.s, z1.s
 ; CHECK-NEXT:    ptest p0, p1.b
 ; CHECK-NEXT:    cset w0, ne
 ; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpge.nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %1)
-  %conv = zext i1 %2 to i32
+  %pg4 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
+  %cmp = tail call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpge.nxv4f32(<vscale x 4 x i1> %pg4, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
+  %cmp16 = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %cmp)
+  %any = tail call i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1> %pg, <vscale x 16 x i1> %cmp16)
+  %conv = zext i1 %any to i32
   ret i32 %conv
 }
 
-define i32 @fcmpgt_nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
+define i32 @fcmpgt_nxv4f32(<vscale x 16 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
 ; CHECK-LABEL: fcmpgt_nxv4f32:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    fcmgt p1.s, p0/z, z0.s, z1.s
 ; CHECK-NEXT:    ptest p0, p1.b
 ; CHECK-NEXT:    cset w0, ne
 ; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpgt.nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %1)
-  %conv = zext i1 %2 to i32
+  %pg4 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
+  %cmp = tail call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpgt.nxv4f32(<vscale x 4 x i1> %pg4, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
+  %cmp16 = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %cmp)
+  %any = tail call i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1> %pg, <vscale x 16 x i1> %cmp16)
+  %conv = zext i1 %any to i32
   ret i32 %conv
 }
 
-define i32 @fcmpuo_nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
+define i32 @fcmpuo_nxv4f32(<vscale x 16 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b) {
 ; CHECK-LABEL: fcmpuo_nxv4f32:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    fcmuo p1.s, p0/z, z0.s, z1.s
 ; CHECK-NEXT:    ptest p0, p1.b
 ; CHECK-NEXT:    cset w0, ne
 ; CHECK-NEXT:    ret
-  %1 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpuo.nxv4f32(<vscale x 4 x i1> %pg, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
-  %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1> %pg, <vscale x 4 x i1> %1)
-  %conv = zext i1 %2 to i32
+  %pg4 = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> %pg)
+  %cmp = tail call <vscale x 4 x i1> @llvm.aarch64.sve.fcmpuo.nxv4f32(<vscale x 4 x i1> %pg4, <vscale x 4 x float> %a, <vscale x 4 x float> %b)
+  %cmp16 = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1> %cmp)
+  %any = tail call i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1> %pg, <vscale x 16 x i1> %cmp16)
+  %conv = zext i1 %any to i32
   ret i32 %conv
 }
 
@@ -75,6 +87,6 @@ declare <vscale x 4 x i1> @llvm.aarch64.sve.fcmpge.nxv4f32(<vscale x 4 x i1>, <v
 declare <vscale x 4 x i1> @llvm.aarch64.sve.fcmpgt.nxv4f32(<vscale x 4 x i1>, <vscale x 4 x float>, <vscale x 4 x float>)
 declare <vscale x 4 x i1> @llvm.aarch64.sve.fcmpuo.nxv4f32(<vscale x 4 x i1>, <vscale x 4 x float>, <vscale x 4 x float>)
 
-declare <vscale x 4 x i1> @llvm.aarch64.sve.ptrue.nxv4i1(i32)
-
-declare i1 @llvm.aarch64.sve.ptest.any.nxv4i1(<vscale x 4 x i1>, <vscale x 4 x i1>)
+declare <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1>)
+declare <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv4i1(<vscale x 4 x i1>)
+declare i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
diff --git a/llvm/test/CodeGen/AArch64/sve-setcc.ll b/llvm/test/CodeGen/AArch64/sve-setcc.ll
index 30e2a77f321206..af67289263edc3 100644
--- a/llvm/test/CodeGen/AArch64/sve-setcc.ll
+++ b/llvm/test/CodeGen/AArch64/sve-setcc.ll
@@ -1,4 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: opt -passes=verify -disable-output %s
 ; RUN: llc -mtriple=aarch64--linux-gnu -mattr=+sve < %s | FileCheck %s
 
 ; Ensure we use the CC result of SVE compare instructions when branching.
@@ -13,7 +14,8 @@ define void @sve_cmplt_setcc(ptr %out, <vscale x 8 x i16> %in, <vscale x 8 x i1>
 ; CHECK-NEXT:    ret
 entry:
   %0 = tail call <vscale x 8 x i1> @llvm.aarch64.sve.cmplt.wide.nxv8i16(<vscale x 8 x i1> %pg, <vscale x 8 x i16> %in, <vscale x 2 x i64> zeroinitializer)
-  %1 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv8i1(<vscale x 8 x i1> %pg, <vscale x 8 x i1> %0)
+  %cmp.svbool = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %0)
+  %1 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1> %cmp.svbool, <vscale x 16 x i1> %cmp.svbool)
   br i1 %1, label %if.then, label %if.end
 
 if.then:
@@ -36,7 +38,8 @@ define void @sve_cmplt_setcc_inverted(ptr %out, <vscale x 8 x i16> %in, <vscale
 ; CHECK-NEXT:    ret
 entry:
   %0 = tail call <vscale x 8 x i1> @llvm.aarch64.sve.cmplt.wide.nxv8i16(<vscale x 8 x i1> %pg, <vscale x 8 x i16> %in, <vscale x 2 x i64> zeroinitializer)
-  %1 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv8i1(<vscale x 8 x i1> %pg, <vscale x 8 x i1> %0)
+  %cmp.svbool = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %0)
+  %1 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1> %cmp.svbool, <vscale x 16 x i1> %cmp.svbool)
   br i1 %1, label %if.end, label %if.then
 
 if.then:
@@ -62,7 +65,9 @@ define void @sve_cmplt_setcc_hslo(ptr %out, <vscale x 8 x i16> %in, <vscale x 8
 ; CHECK-NEXT:    ret
 entry:
   %0 = tail call <vscale x 8 x i1> @llvm.aarch64.sve.cmplt.wide.nxv8i16(<vscale x 8 x i1> %pg, <vscale x 8 x i16> %in, <vscale x 2 x i64> zeroinitializer)
-  %1 = tail call i1 @llvm.aarch64.sve.ptest.last.nxv8i1(<vscale x 8 x i1> %pg, <vscale x 8 x i1> %0)
+  %pg.svbool = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %pg)
+  %cmp.svbool = tail call <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1> %0)
+  %1 = tail call i1 @llvm.aarch64.sve.ptest.last.nxv16i1(<vscale x 16 x i1> %pg.svbool, <vscale x 16 x i1> %cmp.svbool)
   br i1 %1, label %if.then, label %if.end
 
 if.then:
@@ -118,8 +123,9 @@ define <vscale x 16 x i1> @sve_cmpne_setcc_different_pred(<vscale x 16 x i8> %ve
 
 declare <vscale x 16 x i1> @llvm.aarch64.sve.cmpne.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>, <vscale x 16 x i8>)
 
-declare i1 @llvm.aarch64.sve.ptest.any.nxv8i1(<vscale x 8 x i1>, <vscale x 8 x i1>)
-declare i1 @llvm.aarch64.sve.ptest.last.nxv8i1(<vscale x 8 x i1>, <vscale x 8 x i1>)
+declare <vscale x 16 x i1> @llvm.aarch64.sve.convert.to.svbool.nxv8i1(<vscale x 8 x i1>)
+declare i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
+declare i1 @llvm.aarch64.sve.ptest.last.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
 
 declare <vscale x 8 x i1> @llvm.aarch64.sve.cmplt.wide.nxv8i16(<vscale x 8 x i1>, <vscale x 8 x i16>, <vscale x 2 x i64>)
 
diff --git a/llvm/test/CodeGen/AArch64/sve-structured-store-memoperands.ll b/llvm/test/CodeGen/AArch64/sve-structured-store-memoperands.ll
index 6372f0acf78414..41459a28432ee8 100644
--- a/llvm/test/CodeGen/AArch64/sve-structured-store-memoperands.ll
+++ b/llvm/test/CodeGen/AArch64/sve-structured-store-memoperands.ll
@@ -1,5 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 6
-; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -stop-after=aarch64-isel -o - < %s | FileCheck %s
+; RUN: llc -mattr=+sve2p1 -stop-after=aarch64-isel -o - < %s | FileCheck %s
+
+target triple = "aarch64"
 
 define void @st2b_imm_mmo(<vscale x 16 x i8> %v0, <vscale x 16 x i8> %v1,
   ; CHECK-LABEL: name: st2b_imm_mmo
diff --git a/llvm/test/CodeGen/AArch64/sve2-intrinsics-contiguous-conflict-detection.ll b/llvm/test/CodeGen/AArch64/sve2-intrinsics-contiguous-conflict-detection.ll
index 27416375ad6aff..8768f1a9cbb39c 100644
--- a/llvm/test/CodeGen/AArch64/sve2-intrinsics-contiguous-conflict-detection.ll
+++ b/llvm/test/CodeGen/AArch64/sve2-intrinsics-contiguous-conflict-detection.ll
@@ -1,4 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: opt -passes=verify -disable-output %s
 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve2 < %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve,+sme < %s | FileCheck %s
 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -force-streaming < %s | FileCheck %s
diff --git a/llvm/test/CodeGen/AArch64/sve2-intrinsics-psel.ll b/llvm/test/CodeGen/AArch64/sve2-intrinsics-psel.ll
index aaa7c4d5829581..2b7d3de718f99d 100644
--- a/llvm/test/CodeGen/AArch64/sve2-intrinsics-psel.ll
+++ b/llvm/test/CodeGen/AArch64/sve2-intrinsics-psel.ll
@@ -87,7 +87,7 @@ define <vscale x 16 x i1> @psel_d_imm(<vscale x 16 x i1> %p1, <vscale x 2 x i1>
   ret <vscale x 16 x i1> %res
 }
 
-define target("aarch64.svcount") @psel_svcount_b(target("aarch64.svcount") %p1, <vscale x 16 x i1> %p2, i32 %idx) {
+define target("aarch64.svcount") @psel_svcount_b(target("aarch64.svcount") %p1, <vscale x 16 x i1> %p2, i32 %idx) "target-features"="+sme2" {
 ; CHECK-LABEL: psel_svcount_b:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    mov w12, w0
@@ -97,7 +97,7 @@ define target("aarch64.svcount") @psel_svcount_b(target("aarch64.svcount") %p1,
   ret target("aarch64.svcount") %res
 }
 
-define target("aarch64.svcount") @psel_svcount_b_imm(target("aarch64.svcount") %p1, <vscale x 16 x i1> %p2, i32 %idx) {
+define target("aarch64.svcount") @psel_svcount_b_imm(target("aarch64.svcount") %p1, <vscale x 16 x i1> %p2, i32 %idx) "target-features"="+sme2" {
 ; CHECK-LABEL: psel_svcount_b_imm:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    mov w12, w0
@@ -108,7 +108,7 @@ define target("aarch64.svcount") @psel_svcount_b_imm(target("aarch64.svcount") %
   ret target("aarch64.svcount") %res
 }
 
-define target("aarch64.svcount") @psel_svcount_h(target("aarch64.svcount") %p1, <vscale x 8 x i1> %p2, i32 %idx) {
+define target("aarch64.svcount") @psel_svcount_h(target("aarch64.svcount") %p1, <vscale x 8 x i1> %p2, i32 %idx) "target-features"="+sme2" {
 ; CHECK-LABEL: psel_svcount_h:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    mov w12, w0
@@ -118,7 +118,7 @@ define target("aarch64.svcount") @psel_svcount_h(target("aarch64.svcount") %p1,
   ret target("aarch64.svcount") %res
 }
 
-define target("aarch64.svcount") @psel_svcount_h_imm(target("aarch64.svcount") %p1, <vscale x 8 x i1> %p2, i32 %idx) {
+define target("aarch64.svcount") @psel_svcount_h_imm(target("aarch64.svcount") %p1, <vscale x 8 x i1> %p2, i32 %idx) "target-features"="+sme2" {
 ; CHECK-LABEL: psel_svcount_h_imm:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    mov w12, w0
@@ -129,7 +129,7 @@ define target("aarch64.svcount") @psel_svcount_h_imm(target("aarch64.svcount") %
   ret target("aarch64.svcount") %res
 }
 
-define target("aarch64.svcount") @psel_svcount_s(target("aarch64.svcount") %p1, <vscale x 4 x i1> %p2, i32 %idx) {
+define target("aarch64.svcount") @psel_svcount_s(target("aarch64.svcount") %p1, <vscale x 4 x i1> %p2, i32 %idx) "target-features"="+sme2" {
 ; CHECK-LABEL: psel_svcount_s:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    mov w12, w0
@@ -139,7 +139,7 @@ define target("aarch64.svcount") @psel_svcount_s(target("aarch64.svcount") %p1,
   ret target("aarch64.svcount") %res
 }
 
-define target("aarch64.svcount") @psel_svcount_s_imm(target("aarch64.svcount") %p1, <vscale x 4 x i1> %p2, i32 %idx) {
+define target("aarch64.svcount") @psel_svcount_s_imm(target("aarch64.svcount") %p1, <vscale x 4 x i1> %p2, i32 %idx) "target-features"="+sme2" {
 ; CHECK-LABEL: psel_svcount_s_imm:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    mov w12, w0
@@ -150,7 +150,7 @@ define target("aarch64.svcount") @psel_svcount_s_imm(target("aarch64.svcount") %
   ret target("aarch64.svcount") %res
 }
 
-define target("aarch64.svcount") @psel_svcount_d(target("aarch64.svcount") %p1, <vscale x 2 x i1> %p2, i32 %idx) {
+define target("aarch64.svcount") @psel_svcount_d(target("aarch64.svcount") %p1, <vscale x 2 x i1> %p2, i32 %idx) "target-features"="+sme2" {
 ; CHECK-LABEL: psel_svcount_d:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    mov w12, w0
@@ -160,7 +160,7 @@ define target("aarch64.svcount") @psel_svcount_d(target("aarch64.svcount") %p1,
   ret target("aarch64.svcount") %res
 }
 
-define target("aarch64.svcount") @psel_svcount_d_imm(target("aarch64.svcount") %p1, <vscale x 2 x i1> %p2, i32 %idx) {
+define target("aarch64.svcount") @psel_svcount_d_imm(target("aarch64.svcount") %p1, <vscale x 2 x i1> %p2, i32 %idx) "target-features"="+sme2" {
 ; CHECK-LABEL: psel_svcount_d_imm:
 ; CHECK:       // %bb.0:
 ; CHECK-NEXT:    mov w12, w0
diff --git a/llvm/test/CodeGen/AArch64/zeroing-forms-frint-frecpx-fsqrt.ll b/llvm/test/CodeGen/AArch64/zeroing-forms-frint-frecpx-fsqrt.ll
index 4935d99bc965cd..9dea6136cc5b36 100644
--- a/llvm/test/CodeGen/AArch64/zeroing-forms-frint-frecpx-fsqrt.ll
+++ b/llvm/test/CodeGen/AArch64/zeroing-forms-frint-frecpx-fsqrt.ll
@@ -62,165 +62,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-define <vscale x 4 x half> @test_svrinta_4f16_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrinta_4f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frinta z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinta_4f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinta z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frinta.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrinta_4f16_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrinta_4f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frinta z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinta_4f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinta z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frinta.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrinta_4f16_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; SVE-LABEL: test_svrinta_4f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frinta z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinta_4f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinta z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrinta_4f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frinta z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frinta.nxv4f16(<vscale x 4 x half> zeroinitializer, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrinta_2f16_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrinta_2f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frinta z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinta_2f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinta z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frinta.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrinta_2f16_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrinta_2f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frinta z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinta_2f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinta z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frinta.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrinta_2f16_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; SVE-LABEL: test_svrinta_2f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frinta z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinta_2f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinta z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrinta_2f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frinta z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frinta.nxv2f16(<vscale x 2 x half> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x float> @test_svrinta_2f32_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrinta_2f32_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frinta z0.s, p0/m, z0.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinta_2f32_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinta z0.s, p0/z, z0.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frinta.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrinta_2f32_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrinta_2f32_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frinta z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinta_2f32_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinta z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frinta.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrinta_2f32_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; SVE-LABEL: test_svrinta_2f32_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frinta z0.s, p0/m, z1.s
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinta_2f32_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinta z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrinta_2f32_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.s, #0 // =0x0
-; STREAMING-SVE-NEXT:    frinta z0.s, p0/m, z1.s
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frinta.nxv2f32(<vscale x 2 x float> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
 define <vscale x 4 x float> @test_svrinta_f32_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svrinta_f32_x_1:
 ; CHECK:       // %bb.0: // %entry
@@ -380,165 +221,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-define <vscale x 4 x half> @test_svrinti_4f16_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrinti_4f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frinti z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinti_4f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinti z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frinti.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrinti_4f16_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrinti_4f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frinti z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinti_4f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinti z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frinti.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrinti_4f16_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; SVE-LABEL: test_svrinti_4f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frinti z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinti_4f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinti z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrinti_4f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frinti z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frinti.nxv4f16(<vscale x 4 x half> zeroinitializer, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrinti_2f16_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrinti_2f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frinti z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinti_2f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinti z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frinti.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrinti_2f16_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrinti_2f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frinti z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinti_2f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinti z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frinti.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrinti_2f16_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; SVE-LABEL: test_svrinti_2f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frinti z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinti_2f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinti z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrinti_2f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frinti z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frinti.nxv2f16(<vscale x 2 x half> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x float> @test_svrinti_2f32_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrinti_2f32_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frinti z0.s, p0/m, z0.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinti_2f32_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinti z0.s, p0/z, z0.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frinti.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrinti_2f32_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrinti_2f32_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frinti z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinti_2f32_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinti z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frinti.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrinti_2f32_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; SVE-LABEL: test_svrinti_2f32_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frinti z0.s, p0/m, z1.s
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrinti_2f32_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frinti z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrinti_2f32_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.s, #0 // =0x0
-; STREAMING-SVE-NEXT:    frinti z0.s, p0/m, z1.s
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frinti.nxv2f32(<vscale x 2 x float> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
 define <vscale x 4 x float> @test_svrinti_f32_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svrinti_f32_x_1:
 ; CHECK:       // %bb.0: // %entry
@@ -623,7 +305,6 @@ entry:
   ret <vscale x 2 x double> %0
 }
 
-
 define <vscale x 2 x double> @test_svrinti_f64_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x double> %x) {
 ; SVE-LABEL: test_svrinti_f64_z:
 ; SVE:       // %bb.0: // %entry
@@ -646,7 +327,6 @@ entry:
   ret <vscale x 2 x double> %0
 }
 
-
 define <vscale x 8 x half> @test_svrintm_f16_x_1(<vscale x 8 x i1> %pg, <vscale x 8 x half> %x) {
 ; CHECK-LABEL: test_svrintm_f16_x_1:
 ; CHECK:       // %bb.0: // %entry
@@ -678,7 +358,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-
 define <vscale x 8 x half> @test_svrintm_f16_z(<vscale x 8 x i1> %pg, double %z0, <vscale x 8 x half> %x) {
 ; SVE-LABEL: test_svrintm_f16_z:
 ; SVE:       // %bb.0: // %entry
@@ -701,212 +380,53 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-define <vscale x 4 x half> @test_svrintm_4f16_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrintm_4f16_x_1:
+define <vscale x 4 x float> @test_svrintm_f32_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x float> %x) {
+; CHECK-LABEL: test_svrintm_f32_x_1:
 ; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintm z0.h, p0/m, z0.h
+; CHECK-NEXT:    frintm z0.s, p0/m, z0.s
 ; CHECK-NEXT:    ret
 ;
-; CHECK-2p2-LABEL: test_svrintm_4f16_x_1:
+; CHECK-2p2-LABEL: test_svrintm_f32_x_1:
 ; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintm z0.h, p0/z, z0.h
+; CHECK-2p2-NEXT:    frintm z0.s, p0/z, z0.s
 ; CHECK-2p2-NEXT:    ret
 entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintm.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
+  %0 = tail call <vscale x 4 x float> @llvm.aarch64.sve.frintm.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x i1> %pg, <vscale x 4 x float> %x)
+  ret <vscale x 4 x float> %0
 }
 
-define <vscale x 4 x half> @test_svrintm_4f16_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrintm_4f16_x_2:
+define <vscale x 4 x float> @test_svrintm_f32_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x float> %x) {
+; CHECK-LABEL: test_svrintm_f32_x_2:
 ; CHECK:       // %bb.0: // %entry
 ; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintm z0.h, p0/m, z1.h
+; CHECK-NEXT:    frintm z0.s, p0/m, z1.s
 ; CHECK-NEXT:    ret
 ;
-; CHECK-2p2-LABEL: test_svrintm_4f16_x_2:
+; CHECK-2p2-LABEL: test_svrintm_f32_x_2:
 ; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintm z0.h, p0/z, z1.h
+; CHECK-2p2-NEXT:    frintm z0.s, p0/z, z1.s
 ; CHECK-2p2-NEXT:    ret
 entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintm.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
+  %0 = tail call <vscale x 4 x float> @llvm.aarch64.sve.frintm.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x i1> %pg, <vscale x 4 x float> %x)
+  ret <vscale x 4 x float> %0
 }
 
-define <vscale x 4 x half> @test_svrintm_4f16_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; SVE-LABEL: test_svrintm_4f16_z:
+define <vscale x 4 x float> @test_svrintm_f32_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x float> %x) {
+; SVE-LABEL: test_svrintm_f32_z:
 ; SVE:       // %bb.0: // %entry
 ; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintm z0.h, p0/m, z1.h
+; SVE-NEXT:    frintm z0.s, p0/m, z1.s
 ; SVE-NEXT:    ret
 ;
-; CHECK-2p2-LABEL: test_svrintm_4f16_z:
+; CHECK-2p2-LABEL: test_svrintm_f32_z:
 ; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintm z0.h, p0/z, z1.h
+; CHECK-2p2-NEXT:    frintm z0.s, p0/z, z1.s
 ; CHECK-2p2-NEXT:    ret
 ;
-; STREAMING-SVE-LABEL: test_svrintm_4f16_z:
+; STREAMING-SVE-LABEL: test_svrintm_f32_z:
 ; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintm z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintm.nxv4f16(<vscale x 4 x half> zeroinitializer, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintm_2f16_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrintm_2f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintm z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintm_2f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintm z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintm.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintm_2f16_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrintm_2f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintm z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintm_2f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintm z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintm.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintm_2f16_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; SVE-LABEL: test_svrintm_2f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintm z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintm_2f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintm z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintm_2f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintm z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintm.nxv2f16(<vscale x 2 x half> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x float> @test_svrintm_2f32_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrintm_2f32_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintm z0.s, p0/m, z0.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintm_2f32_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintm z0.s, p0/z, z0.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintm.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrintm_2f32_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrintm_2f32_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintm z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintm_2f32_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintm z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintm.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrintm_2f32_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; SVE-LABEL: test_svrintm_2f32_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintm z0.s, p0/m, z1.s
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintm_2f32_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintm z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintm_2f32_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.s, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintm z0.s, p0/m, z1.s
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintm.nxv2f32(<vscale x 2 x float> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 4 x float> @test_svrintm_f32_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x float> %x) {
-; CHECK-LABEL: test_svrintm_f32_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintm z0.s, p0/m, z0.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintm_f32_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintm z0.s, p0/z, z0.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x float> @llvm.aarch64.sve.frintm.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x i1> %pg, <vscale x 4 x float> %x)
-  ret <vscale x 4 x float> %0
-}
-
-define <vscale x 4 x float> @test_svrintm_f32_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x float> %x) {
-; CHECK-LABEL: test_svrintm_f32_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintm z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintm_f32_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintm z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x float> @llvm.aarch64.sve.frintm.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x i1> %pg, <vscale x 4 x float> %x)
-  ret <vscale x 4 x float> %0
-}
-
-define <vscale x 4 x float> @test_svrintm_f32_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x float> %x) {
-; SVE-LABEL: test_svrintm_f32_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintm z0.s, p0/m, z1.s
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintm_f32_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintm z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintm_f32_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.s, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintm z0.s, p0/m, z1.s
+; STREAMING-SVE-NEXT:    mov z0.s, #0 // =0x0
+; STREAMING-SVE-NEXT:    frintm z0.s, p0/m, z1.s
 ; STREAMING-SVE-NEXT:    ret
 entry:
   %0 = tail call <vscale x 4 x float> @llvm.aarch64.sve.frintm.nxv4f32(<vscale x 4 x float> zeroinitializer, <vscale x 4 x i1> %pg, <vscale x 4 x float> %x)
@@ -1019,165 +539,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-define <vscale x 4 x half> @test_svrintn_4f16_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrintn_4f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintn z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintn_4f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintn z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintn.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrintn_4f16_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrintn_4f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintn z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintn_4f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintn z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintn.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrintn_4f16_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; SVE-LABEL: test_svrintn_4f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintn z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintn_4f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintn z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintn_4f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintn z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintn.nxv4f16(<vscale x 4 x half> zeroinitializer, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintn_2f16_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrintn_2f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintn z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintn_2f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintn z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintn.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintn_2f16_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrintn_2f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintn z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintn_2f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintn z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintn.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintn_2f16_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; SVE-LABEL: test_svrintn_2f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintn z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintn_2f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintn z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintn_2f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintn z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintn.nxv2f16(<vscale x 2 x half> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x float> @test_svrintn_2f32_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrintn_2f32_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintn z0.s, p0/m, z0.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintn_2f32_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintn z0.s, p0/z, z0.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintn.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrintn_2f32_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrintn_2f32_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintn z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintn_2f32_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintn z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintn.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrintn_2f32_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; SVE-LABEL: test_svrintn_2f32_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintn z0.s, p0/m, z1.s
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintn_2f32_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintn z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintn_2f32_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.s, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintn z0.s, p0/m, z1.s
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintn.nxv2f32(<vscale x 2 x float> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
 define <vscale x 4 x float> @test_svrintn_f32_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svrintn_f32_x_1:
 ; CHECK:       // %bb.0: // %entry
@@ -1337,198 +698,39 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-define <vscale x 4 x half> @test_svrintp_4f16_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrintp_4f16_x_1:
+define <vscale x 4 x float> @test_svrintp_f32_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x float> %x) {
+; CHECK-LABEL: test_svrintp_f32_x_1:
 ; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintp z0.h, p0/m, z0.h
+; CHECK-NEXT:    frintp z0.s, p0/m, z0.s
 ; CHECK-NEXT:    ret
 ;
-; CHECK-2p2-LABEL: test_svrintp_4f16_x_1:
+; CHECK-2p2-LABEL: test_svrintp_f32_x_1:
 ; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintp z0.h, p0/z, z0.h
+; CHECK-2p2-NEXT:    frintp z0.s, p0/z, z0.s
 ; CHECK-2p2-NEXT:    ret
 entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintp.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
+  %0 = tail call <vscale x 4 x float> @llvm.aarch64.sve.frintp.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x i1> %pg, <vscale x 4 x float> %x)
+  ret <vscale x 4 x float> %0
 }
 
-define <vscale x 4 x half> @test_svrintp_4f16_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrintp_4f16_x_2:
+define <vscale x 4 x float> @test_svrintp_f32_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x float> %x) {
+; CHECK-LABEL: test_svrintp_f32_x_2:
 ; CHECK:       // %bb.0: // %entry
 ; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintp z0.h, p0/m, z1.h
+; CHECK-NEXT:    frintp z0.s, p0/m, z1.s
 ; CHECK-NEXT:    ret
 ;
-; CHECK-2p2-LABEL: test_svrintp_4f16_x_2:
+; CHECK-2p2-LABEL: test_svrintp_f32_x_2:
 ; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintp z0.h, p0/z, z1.h
+; CHECK-2p2-NEXT:    frintp z0.s, p0/z, z1.s
 ; CHECK-2p2-NEXT:    ret
 entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintp.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
+  %0 = tail call <vscale x 4 x float> @llvm.aarch64.sve.frintp.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x i1> %pg, <vscale x 4 x float> %x)
+  ret <vscale x 4 x float> %0
 }
 
-define <vscale x 4 x half> @test_svrintp_4f16_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; SVE-LABEL: test_svrintp_4f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintp z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintp_4f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintp z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintp_4f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintp z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintp.nxv4f16(<vscale x 4 x half> zeroinitializer, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintp_2f16_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrintp_2f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintp z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintp_2f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintp z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintp.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintp_2f16_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrintp_2f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintp z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintp_2f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintp z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintp.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintp_2f16_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; SVE-LABEL: test_svrintp_2f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintp z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintp_2f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintp z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintp_2f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintp z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintp.nxv2f16(<vscale x 2 x half> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x float> @test_svrintp_2f32_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrintp_2f32_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintp z0.s, p0/m, z0.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintp_2f32_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintp z0.s, p0/z, z0.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintp.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrintp_2f32_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrintp_2f32_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintp z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintp_2f32_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintp z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintp.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrintp_2f32_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; SVE-LABEL: test_svrintp_2f32_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintp z0.s, p0/m, z1.s
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintp_2f32_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintp z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintp_2f32_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.s, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintp z0.s, p0/m, z1.s
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintp.nxv2f32(<vscale x 2 x float> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 4 x float> @test_svrintp_f32_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x float> %x) {
-; CHECK-LABEL: test_svrintp_f32_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintp z0.s, p0/m, z0.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintp_f32_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintp z0.s, p0/z, z0.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x float> @llvm.aarch64.sve.frintp.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x i1> %pg, <vscale x 4 x float> %x)
-  ret <vscale x 4 x float> %0
-}
-
-define <vscale x 4 x float> @test_svrintp_f32_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x float> %x) {
-; CHECK-LABEL: test_svrintp_f32_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintp z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintp_f32_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintp z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x float> @llvm.aarch64.sve.frintp.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x i1> %pg, <vscale x 4 x float> %x)
-  ret <vscale x 4 x float> %0
-}
-
-define <vscale x 4 x float> @test_svrintp_f32_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x float> %x) {
-; SVE-LABEL: test_svrintp_f32_z:
+define <vscale x 4 x float> @test_svrintp_f32_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x float> %x) {
+; SVE-LABEL: test_svrintp_f32_z:
 ; SVE:       // %bb.0: // %entry
 ; SVE-NEXT:    movi v0.2d, #0000000000000000
 ; SVE-NEXT:    frintp z0.s, p0/m, z1.s
@@ -1580,7 +782,6 @@ entry:
   ret <vscale x 2 x double> %0
 }
 
-
 define <vscale x 2 x double> @test_svrintp_f64_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x double> %x) {
 ; SVE-LABEL: test_svrintp_f64_z:
 ; SVE:       // %bb.0: // %entry
@@ -1656,165 +857,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-define <vscale x 4 x half> @test_svrintx_4f16_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrintx_4f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintx z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintx_4f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintx z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintx.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrintx_4f16_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrintx_4f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintx z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintx_4f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintx z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintx.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrintx_4f16_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; SVE-LABEL: test_svrintx_4f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintx z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintx_4f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintx z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintx_4f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintx z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintx.nxv4f16(<vscale x 4 x half> zeroinitializer, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintx_2f16_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrintx_2f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintx z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintx_2f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintx z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintx.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintx_2f16_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrintx_2f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintx z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintx_2f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintx z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintx.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintx_2f16_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; SVE-LABEL: test_svrintx_2f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintx z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintx_2f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintx z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintx_2f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintx z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintx.nxv2f16(<vscale x 2 x half> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x float> @test_svrintx_2f32_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrintx_2f32_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintx z0.s, p0/m, z0.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintx_2f32_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintx z0.s, p0/z, z0.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintx.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrintx_2f32_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrintx_2f32_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintx z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintx_2f32_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintx z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintx.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrintx_2f32_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; SVE-LABEL: test_svrintx_2f32_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintx z0.s, p0/m, z1.s
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintx_2f32_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintx z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintx_2f32_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.s, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintx z0.s, p0/m, z1.s
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintx.nxv2f32(<vscale x 2 x float> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
 define <vscale x 4 x float> @test_svrintx_f32_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svrintx_f32_x_1:
 ; CHECK:       // %bb.0: // %entry
@@ -1924,213 +966,54 @@ entry:
 define <vscale x 8 x half> @test_svrintz_f16_x_1(<vscale x 8 x i1> %pg, <vscale x 8 x half> %x) {
 ; CHECK-LABEL: test_svrintz_f16_x_1:
 ; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintz z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintz_f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 8 x half> @llvm.aarch64.sve.frintz.nxv8f16(<vscale x 8 x half> poison, <vscale x 8 x i1> %pg, <vscale x 8 x half> %x)
-  ret <vscale x 8 x half> %0
-}
-
-define <vscale x 8 x half> @test_svrintz_f16_x_2(<vscale x 8 x i1> %pg, double %z0, <vscale x 8 x half> %x) {
-; CHECK-LABEL: test_svrintz_f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintz z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintz_f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 8 x half> @llvm.aarch64.sve.frintz.nxv8f16(<vscale x 8 x half> poison, <vscale x 8 x i1> %pg, <vscale x 8 x half> %x)
-  ret <vscale x 8 x half> %0
-}
-
-define <vscale x 8 x half> @test_svrintz_f16_z(<vscale x 8 x i1> %pg, double %z0, <vscale x 8 x half> %x) {
-; SVE-LABEL: test_svrintz_f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintz z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintz_f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintz_f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintz z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 8 x half> @llvm.aarch64.sve.frintz.nxv8f16(<vscale x 8 x half> zeroinitializer, <vscale x 8 x i1> %pg, <vscale x 8 x half> %x)
-  ret <vscale x 8 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrintz_4f16_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrintz_4f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintz z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintz_4f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintz.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrintz_4f16_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrintz_4f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintz z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintz_4f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintz.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrintz_4f16_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; SVE-LABEL: test_svrintz_4f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintz z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintz_4f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintz_4f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintz z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintz.nxv4f16(<vscale x 4 x half> zeroinitializer, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintz_2f16_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrintz_2f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintz z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintz_2f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintz.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintz_2f16_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrintz_2f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintz z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintz_2f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintz.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrintz_2f16_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; SVE-LABEL: test_svrintz_2f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintz z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrintz_2f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrintz_2f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintz z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintz.nxv2f16(<vscale x 2 x half> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x float> @test_svrintz_2f32_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrintz_2f32_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frintz z0.s, p0/m, z0.s
+; CHECK-NEXT:    frintz z0.h, p0/m, z0.h
 ; CHECK-NEXT:    ret
 ;
-; CHECK-2p2-LABEL: test_svrintz_2f32_x_1:
+; CHECK-2p2-LABEL: test_svrintz_f16_x_1:
 ; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintz z0.s, p0/z, z0.s
+; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z0.h
 ; CHECK-2p2-NEXT:    ret
 entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintz.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
+  %0 = tail call <vscale x 8 x half> @llvm.aarch64.sve.frintz.nxv8f16(<vscale x 8 x half> poison, <vscale x 8 x i1> %pg, <vscale x 8 x half> %x)
+  ret <vscale x 8 x half> %0
 }
 
-define <vscale x 2 x float> @test_svrintz_2f32_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrintz_2f32_x_2:
+define <vscale x 8 x half> @test_svrintz_f16_x_2(<vscale x 8 x i1> %pg, double %z0, <vscale x 8 x half> %x) {
+; CHECK-LABEL: test_svrintz_f16_x_2:
 ; CHECK:       // %bb.0: // %entry
 ; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintz z0.s, p0/m, z1.s
+; CHECK-NEXT:    frintz z0.h, p0/m, z1.h
 ; CHECK-NEXT:    ret
 ;
-; CHECK-2p2-LABEL: test_svrintz_2f32_x_2:
+; CHECK-2p2-LABEL: test_svrintz_f16_x_2:
 ; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintz z0.s, p0/z, z1.s
+; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z1.h
 ; CHECK-2p2-NEXT:    ret
 entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintz.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
+  %0 = tail call <vscale x 8 x half> @llvm.aarch64.sve.frintz.nxv8f16(<vscale x 8 x half> poison, <vscale x 8 x i1> %pg, <vscale x 8 x half> %x)
+  ret <vscale x 8 x half> %0
 }
 
-define <vscale x 2 x float> @test_svrintz_2f32_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; SVE-LABEL: test_svrintz_2f32_z:
+define <vscale x 8 x half> @test_svrintz_f16_z(<vscale x 8 x i1> %pg, double %z0, <vscale x 8 x half> %x) {
+; SVE-LABEL: test_svrintz_f16_z:
 ; SVE:       // %bb.0: // %entry
 ; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frintz z0.s, p0/m, z1.s
+; SVE-NEXT:    frintz z0.h, p0/m, z1.h
 ; SVE-NEXT:    ret
 ;
-; CHECK-2p2-LABEL: test_svrintz_2f32_z:
+; CHECK-2p2-LABEL: test_svrintz_f16_z:
 ; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frintz z0.s, p0/z, z1.s
+; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z1.h
 ; CHECK-2p2-NEXT:    ret
 ;
-; STREAMING-SVE-LABEL: test_svrintz_2f32_z:
+; STREAMING-SVE-LABEL: test_svrintz_f16_z:
 ; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.s, #0 // =0x0
-; STREAMING-SVE-NEXT:    frintz z0.s, p0/m, z1.s
+; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
+; STREAMING-SVE-NEXT:    frintz z0.h, p0/m, z1.h
 ; STREAMING-SVE-NEXT:    ret
 entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintz.nxv2f32(<vscale x 2 x float> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
+  %0 = tail call <vscale x 8 x half> @llvm.aarch64.sve.frintz.nxv8f16(<vscale x 8 x half> zeroinitializer, <vscale x 8 x i1> %pg, <vscale x 8 x half> %x)
+  ret <vscale x 8 x half> %0
 }
 
 define <vscale x 4 x float> @test_svrintz_f32_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x float> %x) {
@@ -2292,165 +1175,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-define <vscale x 4 x half> @test_svrecpx_4f16_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrecpx_4f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frecpx z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrecpx_4f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frecpx z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frecpx.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrecpx_4f16_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svrecpx_4f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frecpx z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrecpx_4f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frecpx z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frecpx.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svrecpx_4f16_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; SVE-LABEL: test_svrecpx_4f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frecpx z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrecpx_4f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frecpx z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrecpx_4f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frecpx z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frecpx.nxv4f16(<vscale x 4 x half> zeroinitializer, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrecpx_2f16_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrecpx_2f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frecpx z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrecpx_2f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frecpx z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frecpx.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrecpx_2f16_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svrecpx_2f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frecpx z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrecpx_2f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frecpx z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frecpx.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svrecpx_2f16_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; SVE-LABEL: test_svrecpx_2f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frecpx z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrecpx_2f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frecpx z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrecpx_2f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    frecpx z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frecpx.nxv2f16(<vscale x 2 x half> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x float> @test_svrecpx_2f32_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrecpx_2f32_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    frecpx z0.s, p0/m, z0.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrecpx_2f32_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frecpx z0.s, p0/z, z0.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frecpx.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrecpx_2f32_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svrecpx_2f32_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frecpx z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrecpx_2f32_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frecpx z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frecpx.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svrecpx_2f32_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; SVE-LABEL: test_svrecpx_2f32_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    frecpx z0.s, p0/m, z1.s
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svrecpx_2f32_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    frecpx z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svrecpx_2f32_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.s, #0 // =0x0
-; STREAMING-SVE-NEXT:    frecpx z0.s, p0/m, z1.s
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frecpx.nxv2f32(<vscale x 2 x float> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
 define <vscale x 4 x float> @test_svrecpx_f32_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svrecpx_f32_x_1:
 ; CHECK:       // %bb.0: // %entry
@@ -2602,171 +1326,12 @@ define <vscale x 8 x half> @test_svsqrt_f16_z(<vscale x 8 x i1> %pg, double %z0,
 ;
 ; STREAMING-SVE-LABEL: test_svsqrt_f16_z:
 ; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    fsqrt z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 8 x half> @llvm.aarch64.sve.fsqrt.nxv8f16(<vscale x 8 x half> zeroinitializer, <vscale x 8 x i1> %pg, <vscale x 8 x half> %x)
-  ret <vscale x 8 x half> %0
-}
-
-define <vscale x 4 x half> @test_svsqrt_4f16_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svsqrt_4f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    fsqrt z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svsqrt_4f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    fsqrt z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.fsqrt.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svsqrt_4f16_x_2(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svsqrt_4f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    fsqrt z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svsqrt_4f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    fsqrt z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.fsqrt.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svsqrt_4f16_z(<vscale x 4 x i1> %pg, double %z0, <vscale x 4 x half> %x) {
-; SVE-LABEL: test_svsqrt_4f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    fsqrt z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svsqrt_4f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    fsqrt z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svsqrt_4f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    fsqrt z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.fsqrt.nxv4f16(<vscale x 4 x half> zeroinitializer, <vscale x 4 x i1> %pg, <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 2 x half> @test_svsqrt_2f16_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svsqrt_2f16_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    fsqrt z0.h, p0/m, z0.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svsqrt_2f16_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    fsqrt z0.h, p0/z, z0.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.fsqrt.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svsqrt_2f16_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svsqrt_2f16_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    fsqrt z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svsqrt_2f16_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    fsqrt z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.fsqrt.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svsqrt_2f16_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x half> %x) {
-; SVE-LABEL: test_svsqrt_2f16_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    fsqrt z0.h, p0/m, z1.h
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svsqrt_2f16_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    fsqrt z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svsqrt_2f16_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
-; STREAMING-SVE-NEXT:    fsqrt z0.h, p0/m, z1.h
-; STREAMING-SVE-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.fsqrt.nxv2f16(<vscale x 2 x half> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x float> @test_svsqrt_2f32_x_1(<vscale x 2 x i1> %pg, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svsqrt_2f32_x_1:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    fsqrt z0.s, p0/m, z0.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svsqrt_2f32_x_1:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    fsqrt z0.s, p0/z, z0.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.fsqrt.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svsqrt_2f32_x_2(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svsqrt_2f32_x_2:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    fsqrt z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svsqrt_2f32_x_2:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    fsqrt z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.fsqrt.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svsqrt_2f32_z(<vscale x 2 x i1> %pg, double %z0, <vscale x 2 x float> %x) {
-; SVE-LABEL: test_svsqrt_2f32_z:
-; SVE:       // %bb.0: // %entry
-; SVE-NEXT:    movi v0.2d, #0000000000000000
-; SVE-NEXT:    fsqrt z0.s, p0/m, z1.s
-; SVE-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svsqrt_2f32_z:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    fsqrt z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-;
-; STREAMING-SVE-LABEL: test_svsqrt_2f32_z:
-; STREAMING-SVE:       // %bb.0: // %entry
-; STREAMING-SVE-NEXT:    mov z0.s, #0 // =0x0
-; STREAMING-SVE-NEXT:    fsqrt z0.s, p0/m, z1.s
+; STREAMING-SVE-NEXT:    mov z0.h, #0 // =0x0
+; STREAMING-SVE-NEXT:    fsqrt z0.h, p0/m, z1.h
 ; STREAMING-SVE-NEXT:    ret
 entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.fsqrt.nxv2f32(<vscale x 2 x float> zeroinitializer, <vscale x 2 x i1> %pg, <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
+  %0 = tail call <vscale x 8 x half> @llvm.aarch64.sve.fsqrt.nxv8f16(<vscale x 8 x half> zeroinitializer, <vscale x 8 x i1> %pg, <vscale x 8 x half> %x)
+  ret <vscale x 8 x half> %0
 }
 
 define <vscale x 4 x float> @test_svsqrt_f32_x_1(<vscale x 4 x i1> %pg, <vscale x 4 x float> %x) {
@@ -2911,118 +1476,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-
-define <vscale x 4 x half> @test_svfrinta_nxv4f16_ptrue_u(double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svfrinta_nxv4f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frinta z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrinta_nxv4f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frinta z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frinta.nxv4f16(<vscale x 4 x half> poison,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svfrinta_nxv4f16_ptrue(double %z0, <vscale x 4 x half> %x, <vscale x 4 x half> %y) {
-; CHECK-LABEL: test_svfrinta_nxv4f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frinta z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrinta_nxv4f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frinta z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frinta.nxv4f16(<vscale x 4 x half> %x,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %y)
-  ret <vscale x 4 x half> %0
-}
-
-
-define <vscale x 2 x half> @test_svfrinta_nxv2f16_ptrue_u(double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svfrinta_nxv2f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frinta z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrinta_nxv2f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frinta z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frinta.nxv2f16(<vscale x 2 x half> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svfrinta_nxv2f16_ptrue(double %z0, <vscale x 2 x half> %x, <vscale x 2 x half> %y) {
-; CHECK-LABEL: test_svfrinta_nxv2f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frinta z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrinta_nxv2f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frinta z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frinta.nxv2f16(<vscale x 2 x half> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %y)
-  ret <vscale x 2 x half> %0
-}
-
-
-define <vscale x 2 x float> @test_svfrinta_nxv2f32_ptrue_u(double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svfrinta_nxv2f32_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frinta z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrinta_nxv2f32_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frinta z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frinta.nxv2f32(<vscale x 2 x float> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svfrinta_nxv2f32_ptrue(double %z0, <vscale x 2 x float> %x, <vscale x 2 x float> %y) {
-; CHECK-LABEL: test_svfrinta_nxv2f32_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frinta z0.s, p0/m, z2.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrinta_nxv2f32_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frinta z0.s, p0/z, z2.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frinta.nxv2f32(<vscale x 2 x float> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %y)
-  ret <vscale x 2 x float> %0
-}
-
-
 define <vscale x 4 x float> @test_svfrinta_nxv4f32_ptrue_u(double %z0, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svfrinta_nxv4f32_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3059,7 +1512,6 @@ entry:
   ret <vscale x 4 x float> %0
 }
 
-
 define <vscale x 2 x double> @test_svfrinta_nxv2f64_ptrue_u(double %z0, <vscale x 2 x double> %x) {
 ; CHECK-LABEL: test_svfrinta_nxv2f64_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3096,7 +1548,6 @@ entry:
   ret <vscale x 2 x double> %0
 }
 
-
 define <vscale x 8 x half> @test_svfrinti_nxv8f16_ptrue_u(double %z0, <vscale x 8 x half> %x) {
 ; CHECK-LABEL: test_svfrinti_nxv8f16_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3133,118 +1584,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-
-define <vscale x 4 x half> @test_svfrinti_nxv4f16_ptrue_u(double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svfrinti_nxv4f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frinti z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrinti_nxv4f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frinti z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frinti.nxv4f16(<vscale x 4 x half> poison,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svfrinti_nxv4f16_ptrue(double %z0, <vscale x 4 x half> %x, <vscale x 4 x half> %y) {
-; CHECK-LABEL: test_svfrinti_nxv4f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frinti z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrinti_nxv4f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frinti z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frinti.nxv4f16(<vscale x 4 x half> %x,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %y)
-  ret <vscale x 4 x half> %0
-}
-
-
-define <vscale x 2 x half> @test_svfrinti_nxv2f16_ptrue_u(double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svfrinti_nxv2f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frinti z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrinti_nxv2f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frinti z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frinti.nxv2f16(<vscale x 2 x half> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svfrinti_nxv2f16_ptrue(double %z0, <vscale x 2 x half> %x, <vscale x 2 x half> %y) {
-; CHECK-LABEL: test_svfrinti_nxv2f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frinti z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrinti_nxv2f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frinti z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frinti.nxv2f16(<vscale x 2 x half> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %y)
-  ret <vscale x 2 x half> %0
-}
-
-
-define <vscale x 2 x float> @test_svfrinti_nxv2f32_ptrue_u(double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svfrinti_nxv2f32_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frinti z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrinti_nxv2f32_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frinti z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frinti.nxv2f32(<vscale x 2 x float> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svfrinti_nxv2f32_ptrue(double %z0, <vscale x 2 x float> %x, <vscale x 2 x float> %y) {
-; CHECK-LABEL: test_svfrinti_nxv2f32_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frinti z0.s, p0/m, z2.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrinti_nxv2f32_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frinti z0.s, p0/z, z2.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frinti.nxv2f32(<vscale x 2 x float> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %y)
-  ret <vscale x 2 x float> %0
-}
-
-
 define <vscale x 4 x float> @test_svfrinti_nxv4f32_ptrue_u(double %z0, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svfrinti_nxv4f32_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3281,7 +1620,6 @@ entry:
   ret <vscale x 4 x float> %0
 }
 
-
 define <vscale x 2 x double> @test_svfrinti_nxv2f64_ptrue_u(double %z0, <vscale x 2 x double> %x) {
 ; CHECK-LABEL: test_svfrinti_nxv2f64_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3318,7 +1656,6 @@ entry:
   ret <vscale x 2 x double> %0
 }
 
-
 define <vscale x 8 x half> @test_svfrintm_nxv8f16_ptrue_u(double %z0, <vscale x 8 x half> %x) {
 ; CHECK-LABEL: test_svfrintm_nxv8f16_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3348,125 +1685,13 @@ define <vscale x 8 x half> @test_svfrintm_nxv8f16_ptrue(double %z0, <vscale x 8
 ; CHECK-2p2-LABEL: test_svfrintm_nxv8f16_ptrue:
 ; CHECK-2p2:       // %bb.0: // %entry
 ; CHECK-2p2-NEXT:    ptrue p0.h
-; CHECK-2p2-NEXT:    frintm z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 8 x half> @llvm.aarch64.sve.frintm.nxv8f16(<vscale x 8 x half> %x,  <vscale x 8 x i1> splat (i1 true), <vscale x 8 x half> %y)
-  ret <vscale x 8 x half> %0
-}
-
-
-define <vscale x 4 x half> @test_svfrintm_nxv4f16_ptrue_u(double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svfrintm_nxv4f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintm z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintm_nxv4f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frintm z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintm.nxv4f16(<vscale x 4 x half> poison,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svfrintm_nxv4f16_ptrue(double %z0, <vscale x 4 x half> %x, <vscale x 4 x half> %y) {
-; CHECK-LABEL: test_svfrintm_nxv4f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintm z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintm_nxv4f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frintm z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintm.nxv4f16(<vscale x 4 x half> %x,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %y)
-  ret <vscale x 4 x half> %0
-}
-
-
-define <vscale x 2 x half> @test_svfrintm_nxv2f16_ptrue_u(double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svfrintm_nxv2f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintm z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintm_nxv2f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintm z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintm.nxv2f16(<vscale x 2 x half> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svfrintm_nxv2f16_ptrue(double %z0, <vscale x 2 x half> %x, <vscale x 2 x half> %y) {
-; CHECK-LABEL: test_svfrintm_nxv2f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintm z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintm_nxv2f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintm z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintm.nxv2f16(<vscale x 2 x half> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %y)
-  ret <vscale x 2 x half> %0
-}
-
-
-define <vscale x 2 x float> @test_svfrintm_nxv2f32_ptrue_u(double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svfrintm_nxv2f32_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintm z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintm_nxv2f32_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintm z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintm.nxv2f32(<vscale x 2 x float> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svfrintm_nxv2f32_ptrue(double %z0, <vscale x 2 x float> %x, <vscale x 2 x float> %y) {
-; CHECK-LABEL: test_svfrintm_nxv2f32_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintm z0.s, p0/m, z2.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintm_nxv2f32_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintm z0.s, p0/z, z2.s
+; CHECK-2p2-NEXT:    frintm z0.h, p0/z, z2.h
 ; CHECK-2p2-NEXT:    ret
 entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintm.nxv2f32(<vscale x 2 x float> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %y)
-  ret <vscale x 2 x float> %0
+  %0 = tail call <vscale x 8 x half> @llvm.aarch64.sve.frintm.nxv8f16(<vscale x 8 x half> %x,  <vscale x 8 x i1> splat (i1 true), <vscale x 8 x half> %y)
+  ret <vscale x 8 x half> %0
 }
 
-
 define <vscale x 4 x float> @test_svfrintm_nxv4f32_ptrue_u(double %z0, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svfrintm_nxv4f32_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3503,7 +1728,6 @@ entry:
   ret <vscale x 4 x float> %0
 }
 
-
 define <vscale x 2 x double> @test_svfrintm_nxv2f64_ptrue_u(double %z0, <vscale x 2 x double> %x) {
 ; CHECK-LABEL: test_svfrintm_nxv2f64_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3540,7 +1764,6 @@ entry:
   ret <vscale x 2 x double> %0
 }
 
-
 define <vscale x 8 x half> @test_svfrintn_nxv8f16_ptrue_u(double %z0, <vscale x 8 x half> %x) {
 ; CHECK-LABEL: test_svfrintn_nxv8f16_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3577,118 +1800,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-
-define <vscale x 4 x half> @test_svfrintn_nxv4f16_ptrue_u(double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svfrintn_nxv4f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintn z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintn_nxv4f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frintn z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintn.nxv4f16(<vscale x 4 x half> poison,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svfrintn_nxv4f16_ptrue(double %z0, <vscale x 4 x half> %x, <vscale x 4 x half> %y) {
-; CHECK-LABEL: test_svfrintn_nxv4f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintn z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintn_nxv4f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frintn z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintn.nxv4f16(<vscale x 4 x half> %x,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %y)
-  ret <vscale x 4 x half> %0
-}
-
-
-define <vscale x 2 x half> @test_svfrintn_nxv2f16_ptrue_u(double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svfrintn_nxv2f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintn z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintn_nxv2f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintn z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintn.nxv2f16(<vscale x 2 x half> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svfrintn_nxv2f16_ptrue(double %z0, <vscale x 2 x half> %x, <vscale x 2 x half> %y) {
-; CHECK-LABEL: test_svfrintn_nxv2f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintn z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintn_nxv2f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintn z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintn.nxv2f16(<vscale x 2 x half> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %y)
-  ret <vscale x 2 x half> %0
-}
-
-
-define <vscale x 2 x float> @test_svfrintn_nxv2f32_ptrue_u(double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svfrintn_nxv2f32_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintn z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintn_nxv2f32_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintn z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintn.nxv2f32(<vscale x 2 x float> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svfrintn_nxv2f32_ptrue(double %z0, <vscale x 2 x float> %x, <vscale x 2 x float> %y) {
-; CHECK-LABEL: test_svfrintn_nxv2f32_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintn z0.s, p0/m, z2.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintn_nxv2f32_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintn z0.s, p0/z, z2.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintn.nxv2f32(<vscale x 2 x float> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %y)
-  ret <vscale x 2 x float> %0
-}
-
-
 define <vscale x 4 x float> @test_svfrintn_nxv4f32_ptrue_u(double %z0, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svfrintn_nxv4f32_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3725,7 +1836,6 @@ entry:
   ret <vscale x 4 x float> %0
 }
 
-
 define <vscale x 2 x double> @test_svfrintn_nxv2f64_ptrue_u(double %z0, <vscale x 2 x double> %x) {
 ; CHECK-LABEL: test_svfrintn_nxv2f64_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3762,7 +1872,6 @@ entry:
   ret <vscale x 2 x double> %0
 }
 
-
 define <vscale x 8 x half> @test_svfrintp_nxv8f16_ptrue_u(double %z0, <vscale x 8 x half> %x) {
 ; CHECK-LABEL: test_svfrintp_nxv8f16_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3799,118 +1908,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-
-define <vscale x 4 x half> @test_svfrintp_nxv4f16_ptrue_u(double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svfrintp_nxv4f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintp z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintp_nxv4f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frintp z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintp.nxv4f16(<vscale x 4 x half> poison,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svfrintp_nxv4f16_ptrue(double %z0, <vscale x 4 x half> %x, <vscale x 4 x half> %y) {
-; CHECK-LABEL: test_svfrintp_nxv4f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintp z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintp_nxv4f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frintp z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintp.nxv4f16(<vscale x 4 x half> %x,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %y)
-  ret <vscale x 4 x half> %0
-}
-
-
-define <vscale x 2 x half> @test_svfrintp_nxv2f16_ptrue_u(double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svfrintp_nxv2f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintp z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintp_nxv2f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintp z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintp.nxv2f16(<vscale x 2 x half> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svfrintp_nxv2f16_ptrue(double %z0, <vscale x 2 x half> %x, <vscale x 2 x half> %y) {
-; CHECK-LABEL: test_svfrintp_nxv2f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintp z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintp_nxv2f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintp z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintp.nxv2f16(<vscale x 2 x half> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %y)
-  ret <vscale x 2 x half> %0
-}
-
-
-define <vscale x 2 x float> @test_svfrintp_nxv2f32_ptrue_u(double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svfrintp_nxv2f32_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintp z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintp_nxv2f32_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintp z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintp.nxv2f32(<vscale x 2 x float> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svfrintp_nxv2f32_ptrue(double %z0, <vscale x 2 x float> %x, <vscale x 2 x float> %y) {
-; CHECK-LABEL: test_svfrintp_nxv2f32_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintp z0.s, p0/m, z2.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintp_nxv2f32_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintp z0.s, p0/z, z2.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintp.nxv2f32(<vscale x 2 x float> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %y)
-  ret <vscale x 2 x float> %0
-}
-
-
 define <vscale x 4 x float> @test_svfrintp_nxv4f32_ptrue_u(double %z0, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svfrintp_nxv4f32_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3947,7 +1944,6 @@ entry:
   ret <vscale x 4 x float> %0
 }
 
-
 define <vscale x 2 x double> @test_svfrintp_nxv2f64_ptrue_u(double %z0, <vscale x 2 x double> %x) {
 ; CHECK-LABEL: test_svfrintp_nxv2f64_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -3984,7 +1980,6 @@ entry:
   ret <vscale x 2 x double> %0
 }
 
-
 define <vscale x 8 x half> @test_svfrintx_nxv8f16_ptrue_u(double %z0, <vscale x 8 x half> %x) {
 ; CHECK-LABEL: test_svfrintx_nxv8f16_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -4018,121 +2013,9 @@ define <vscale x 8 x half> @test_svfrintx_nxv8f16_ptrue(double %z0, <vscale x 8
 ; CHECK-2p2-NEXT:    ret
 entry:
   %0 = tail call <vscale x 8 x half> @llvm.aarch64.sve.frintx.nxv8f16(<vscale x 8 x half> %x,  <vscale x 8 x i1> splat (i1 true), <vscale x 8 x half> %y)
-  ret <vscale x 8 x half> %0
-}
-
-
-define <vscale x 4 x half> @test_svfrintx_nxv4f16_ptrue_u(double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svfrintx_nxv4f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintx z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintx_nxv4f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frintx z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintx.nxv4f16(<vscale x 4 x half> poison,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svfrintx_nxv4f16_ptrue(double %z0, <vscale x 4 x half> %x, <vscale x 4 x half> %y) {
-; CHECK-LABEL: test_svfrintx_nxv4f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintx z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintx_nxv4f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frintx z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintx.nxv4f16(<vscale x 4 x half> %x,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %y)
-  ret <vscale x 4 x half> %0
-}
-
-
-define <vscale x 2 x half> @test_svfrintx_nxv2f16_ptrue_u(double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svfrintx_nxv2f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintx z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintx_nxv2f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintx z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintx.nxv2f16(<vscale x 2 x half> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svfrintx_nxv2f16_ptrue(double %z0, <vscale x 2 x half> %x, <vscale x 2 x half> %y) {
-; CHECK-LABEL: test_svfrintx_nxv2f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintx z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintx_nxv2f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintx z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintx.nxv2f16(<vscale x 2 x half> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %y)
-  ret <vscale x 2 x half> %0
-}
-
-
-define <vscale x 2 x float> @test_svfrintx_nxv2f32_ptrue_u(double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svfrintx_nxv2f32_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintx z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintx_nxv2f32_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintx z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintx.nxv2f32(<vscale x 2 x float> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svfrintx_nxv2f32_ptrue(double %z0, <vscale x 2 x float> %x, <vscale x 2 x float> %y) {
-; CHECK-LABEL: test_svfrintx_nxv2f32_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintx z0.s, p0/m, z2.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintx_nxv2f32_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintx z0.s, p0/z, z2.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintx.nxv2f32(<vscale x 2 x float> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %y)
-  ret <vscale x 2 x float> %0
+  ret <vscale x 8 x half> %0
 }
 
-
 define <vscale x 4 x float> @test_svfrintx_nxv4f32_ptrue_u(double %z0, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svfrintx_nxv4f32_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -4169,7 +2052,6 @@ entry:
   ret <vscale x 4 x float> %0
 }
 
-
 define <vscale x 2 x double> @test_svfrintx_nxv2f64_ptrue_u(double %z0, <vscale x 2 x double> %x) {
 ; CHECK-LABEL: test_svfrintx_nxv2f64_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -4206,7 +2088,6 @@ entry:
   ret <vscale x 2 x double> %0
 }
 
-
 define <vscale x 8 x half> @test_svfrintz_nxv8f16_ptrue_u(double %z0, <vscale x 8 x half> %x) {
 ; CHECK-LABEL: test_svfrintz_nxv8f16_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -4243,118 +2124,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-
-define <vscale x 4 x half> @test_svfrintz_nxv4f16_ptrue_u(double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svfrintz_nxv4f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintz z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintz_nxv4f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintz.nxv4f16(<vscale x 4 x half> poison,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svfrintz_nxv4f16_ptrue(double %z0, <vscale x 4 x half> %x, <vscale x 4 x half> %y) {
-; CHECK-LABEL: test_svfrintz_nxv4f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintz z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintz_nxv4f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frintz.nxv4f16(<vscale x 4 x half> %x,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %y)
-  ret <vscale x 4 x half> %0
-}
-
-
-define <vscale x 2 x half> @test_svfrintz_nxv2f16_ptrue_u(double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svfrintz_nxv2f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintz z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintz_nxv2f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintz.nxv2f16(<vscale x 2 x half> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svfrintz_nxv2f16_ptrue(double %z0, <vscale x 2 x half> %x, <vscale x 2 x half> %y) {
-; CHECK-LABEL: test_svfrintz_nxv2f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintz z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintz_nxv2f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintz z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frintz.nxv2f16(<vscale x 2 x half> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %y)
-  ret <vscale x 2 x half> %0
-}
-
-
-define <vscale x 2 x float> @test_svfrintz_nxv2f32_ptrue_u(double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svfrintz_nxv2f32_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frintz z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintz_nxv2f32_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintz z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintz.nxv2f32(<vscale x 2 x float> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svfrintz_nxv2f32_ptrue(double %z0, <vscale x 2 x float> %x, <vscale x 2 x float> %y) {
-; CHECK-LABEL: test_svfrintz_nxv2f32_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frintz z0.s, p0/m, z2.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrintz_nxv2f32_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frintz z0.s, p0/z, z2.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frintz.nxv2f32(<vscale x 2 x float> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %y)
-  ret <vscale x 2 x float> %0
-}
-
-
 define <vscale x 4 x float> @test_svfrintz_nxv4f32_ptrue_u(double %z0, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svfrintz_nxv4f32_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -4391,7 +2160,6 @@ entry:
   ret <vscale x 4 x float> %0
 }
 
-
 define <vscale x 2 x double> @test_svfrintz_nxv2f64_ptrue_u(double %z0, <vscale x 2 x double> %x) {
 ; CHECK-LABEL: test_svfrintz_nxv2f64_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -4428,7 +2196,6 @@ entry:
   ret <vscale x 2 x double> %0
 }
 
-
 define <vscale x 8 x half> @test_svfrecpx_nxv8f16_ptrue_u(double %z0, <vscale x 8 x half> %x) {
 ; CHECK-LABEL: test_svfrecpx_nxv8f16_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -4465,118 +2232,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-
-define <vscale x 4 x half> @test_svfrecpx_nxv4f16_ptrue_u(double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svfrecpx_nxv4f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frecpx z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrecpx_nxv4f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frecpx z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frecpx.nxv4f16(<vscale x 4 x half> poison,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svfrecpx_nxv4f16_ptrue(double %z0, <vscale x 4 x half> %x, <vscale x 4 x half> %y) {
-; CHECK-LABEL: test_svfrecpx_nxv4f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frecpx z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrecpx_nxv4f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    frecpx z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.frecpx.nxv4f16(<vscale x 4 x half> %x,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %y)
-  ret <vscale x 4 x half> %0
-}
-
-
-define <vscale x 2 x half> @test_svfrecpx_nxv2f16_ptrue_u(double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svfrecpx_nxv2f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frecpx z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrecpx_nxv2f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frecpx z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frecpx.nxv2f16(<vscale x 2 x half> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svfrecpx_nxv2f16_ptrue(double %z0, <vscale x 2 x half> %x, <vscale x 2 x half> %y) {
-; CHECK-LABEL: test_svfrecpx_nxv2f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frecpx z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrecpx_nxv2f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frecpx z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.frecpx.nxv2f16(<vscale x 2 x half> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %y)
-  ret <vscale x 2 x half> %0
-}
-
-
-define <vscale x 2 x float> @test_svfrecpx_nxv2f32_ptrue_u(double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svfrecpx_nxv2f32_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    frecpx z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrecpx_nxv2f32_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frecpx z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frecpx.nxv2f32(<vscale x 2 x float> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svfrecpx_nxv2f32_ptrue(double %z0, <vscale x 2 x float> %x, <vscale x 2 x float> %y) {
-; CHECK-LABEL: test_svfrecpx_nxv2f32_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    frecpx z0.s, p0/m, z2.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfrecpx_nxv2f32_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    frecpx z0.s, p0/z, z2.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.frecpx.nxv2f32(<vscale x 2 x float> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %y)
-  ret <vscale x 2 x float> %0
-}
-
-
 define <vscale x 4 x float> @test_svfrecpx_nxv4f32_ptrue_u(double %z0, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svfrecpx_nxv4f32_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -4613,7 +2268,6 @@ entry:
   ret <vscale x 4 x float> %0
 }
 
-
 define <vscale x 2 x double> @test_svfrecpx_nxv2f64_ptrue_u(double %z0, <vscale x 2 x double> %x) {
 ; CHECK-LABEL: test_svfrecpx_nxv2f64_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -4650,7 +2304,6 @@ entry:
   ret <vscale x 2 x double> %0
 }
 
-
 define <vscale x 8 x half> @test_svfsqrt_nxv8f16_ptrue_u(double %z0, <vscale x 8 x half> %x) {
 ; CHECK-LABEL: test_svfsqrt_nxv8f16_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -4687,118 +2340,6 @@ entry:
   ret <vscale x 8 x half> %0
 }
 
-
-define <vscale x 4 x half> @test_svfsqrt_nxv4f16_ptrue_u(double %z0, <vscale x 4 x half> %x) {
-; CHECK-LABEL: test_svfsqrt_nxv4f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    fsqrt z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfsqrt_nxv4f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    fsqrt z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.fsqrt.nxv4f16(<vscale x 4 x half> poison,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %x)
-  ret <vscale x 4 x half> %0
-}
-
-define <vscale x 4 x half> @test_svfsqrt_nxv4f16_ptrue(double %z0, <vscale x 4 x half> %x, <vscale x 4 x half> %y) {
-; CHECK-LABEL: test_svfsqrt_nxv4f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.s
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    fsqrt z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfsqrt_nxv4f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.s
-; CHECK-2p2-NEXT:    fsqrt z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 4 x half> @llvm.aarch64.sve.fsqrt.nxv4f16(<vscale x 4 x half> %x,  <vscale x 4 x i1> splat (i1 true), <vscale x 4 x half> %y)
-  ret <vscale x 4 x half> %0
-}
-
-
-define <vscale x 2 x half> @test_svfsqrt_nxv2f16_ptrue_u(double %z0, <vscale x 2 x half> %x) {
-; CHECK-LABEL: test_svfsqrt_nxv2f16_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    fsqrt z0.h, p0/m, z1.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfsqrt_nxv2f16_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    fsqrt z0.h, p0/z, z1.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.fsqrt.nxv2f16(<vscale x 2 x half> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %x)
-  ret <vscale x 2 x half> %0
-}
-
-define <vscale x 2 x half> @test_svfsqrt_nxv2f16_ptrue(double %z0, <vscale x 2 x half> %x, <vscale x 2 x half> %y) {
-; CHECK-LABEL: test_svfsqrt_nxv2f16_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    fsqrt z0.h, p0/m, z2.h
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfsqrt_nxv2f16_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    fsqrt z0.h, p0/z, z2.h
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x half> @llvm.aarch64.sve.fsqrt.nxv2f16(<vscale x 2 x half> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x half> %y)
-  ret <vscale x 2 x half> %0
-}
-
-
-define <vscale x 2 x float> @test_svfsqrt_nxv2f32_ptrue_u(double %z0, <vscale x 2 x float> %x) {
-; CHECK-LABEL: test_svfsqrt_nxv2f32_ptrue_u:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z1
-; CHECK-NEXT:    fsqrt z0.s, p0/m, z1.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfsqrt_nxv2f32_ptrue_u:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    fsqrt z0.s, p0/z, z1.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.fsqrt.nxv2f32(<vscale x 2 x float> poison,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %x)
-  ret <vscale x 2 x float> %0
-}
-
-define <vscale x 2 x float> @test_svfsqrt_nxv2f32_ptrue(double %z0, <vscale x 2 x float> %x, <vscale x 2 x float> %y) {
-; CHECK-LABEL: test_svfsqrt_nxv2f32_ptrue:
-; CHECK:       // %bb.0: // %entry
-; CHECK-NEXT:    ptrue p0.d
-; CHECK-NEXT:    movprfx z0, z2
-; CHECK-NEXT:    fsqrt z0.s, p0/m, z2.s
-; CHECK-NEXT:    ret
-;
-; CHECK-2p2-LABEL: test_svfsqrt_nxv2f32_ptrue:
-; CHECK-2p2:       // %bb.0: // %entry
-; CHECK-2p2-NEXT:    ptrue p0.d
-; CHECK-2p2-NEXT:    fsqrt z0.s, p0/z, z2.s
-; CHECK-2p2-NEXT:    ret
-entry:
-  %0 = tail call <vscale x 2 x float> @llvm.aarch64.sve.fsqrt.nxv2f32(<vscale x 2 x float> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x float> %y)
-  ret <vscale x 2 x float> %0
-}
-
-
 define <vscale x 4 x float> @test_svfsqrt_nxv4f32_ptrue_u(double %z0, <vscale x 4 x float> %x) {
 ; CHECK-LABEL: test_svfsqrt_nxv4f32_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -4835,7 +2376,6 @@ entry:
   ret <vscale x 4 x float> %0
 }
 
-
 define <vscale x 2 x double> @test_svfsqrt_nxv2f64_ptrue_u(double %z0, <vscale x 2 x double> %x) {
 ; CHECK-LABEL: test_svfsqrt_nxv2f64_ptrue_u:
 ; CHECK:       // %bb.0: // %entry
@@ -4871,4 +2411,3 @@ entry:
   %0 = tail call <vscale x 2 x double> @llvm.aarch64.sve.fsqrt.nxv2f64(<vscale x 2 x double> %x,  <vscale x 2 x i1> splat (i1 true), <vscale x 2 x double> %y)
   ret <vscale x 2 x double> %0
 }
-
diff --git a/llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td b/llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td
new file mode 100644
index 00000000000000..5447aec5583d3f
--- /dev/null
+++ b/llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td
@@ -0,0 +1,47 @@
+// RUN: llvm-tblgen -gen-intrinsic-feature-checks -intrinsic-feature-prefix=aarch64 -intrinsic-feature-namespace=AArch64 \
+// RUN:   -I %p/../../include -I %p/../../lib/Target/AArch64 \
+// RUN:   %p/../../lib/Target/AArch64/AArch64IntrinsicFeatureChecks.td | FileCheck %s
+
+// Guards are parsed literally; the verifier supplies the SME base feature.
+// CHECK-NOT: AArch64StreamingModeFeatures
+// CHECK: {AArch64::FeatureSME2p1, AArch64::FeatureSVE},
+// CHECK-NEXT: {AArch64::FeatureSVE, AArch64::FeatureSVE2p1},
+// CHECK: {AArch64::FeatureSVE2},
+// CHECK: {AArch64::FeatureLUT, AArch64::FeatureSME2, AArch64::FeatureSVE},
+// CHECK-NEXT: {AArch64::FeatureLUT, AArch64::FeatureSVE, AArch64::FeatureSVE2},
+// CHECK: 2, "sve,(sve2p1|sme2p1)"},
+// CHECK-NEXT: {{.*}}"sve2p1|sme2p1"},
+// CHECK: 2, "sve,(sve2|sme2),lut"},
+
+// Overload-only variants expand to complete result and operand signatures.
+// CHECK: MVT::i64, MVT::i32, // int_aarch64_sve_cntb
+// CHECK: MVT::nxv8bf16, MVT::nxv8i1, MVT::nxv8bf16, MVT::nxv8bf16, // int_aarch64_sve_fadd
+// CHECK: MVT::nxv8f16, MVT::nxv4f32, MVT::nxv4f32, // int_aarch64_sve_fcvt_x2
+// CHECK: MVT::nxv2i64, MVT::nxv2i64, MVT::nxv2i1, MVT::nxv2f64, // int_aarch64_sve_fcvtzs
+// CHECK: MVT::nxv16i8, MVT::nxv16i8, MVT::nxv16i1, MVT::iPTR, // int_aarch64_sve_ld2_sret
+// CHECK: MVT::nxv2i1, MVT::iPTR, MVT::nxv2i64, MVT::i32, // int_aarch64_sve_prfb_gather_index
+// CHECK: MVT::nxv8i1, MVT::nxv16i1, // int_aarch64_sve_punpkhi
+// CHECK: MVT::nxv16i8, MVT::nxv16i8, MVT::nxv16i8, MVT::nxv16i8, MVT::nxv16i1, MVT::iPTR, // int_aarch64_sve_st4
+// A streaming-compatible ZT0 intrinsic explicitly uses SME2 in both modes.
+// CHECK: [[ZT_GUARD:[0-9]+]], [[ZT_GUARD]], // int_aarch64_sme_ldr_zt
+// CHECK: {{[0-9]+}}, 0, 2, {{[0-9]+}}, 2, false}, // int_aarch64_sme_ldr_zt
+// CHECK: case Intrinsic::aarch64_sve_fadd:
+// CHECK-NEXT: return ArrayRef(AArch64IntrinsicVariants + {{[0-9]+}}, 4);
+// The contiguous load and store helpers preserve each tuple width.
+// CHECK: case Intrinsic::aarch64_sve_ld1:
+// CHECK-NEXT: return ArrayRef(AArch64IntrinsicVariants + {{[0-9]+}}, 14);
+// CHECK: case Intrinsic::aarch64_sve_ld1rq:
+// CHECK-NEXT: return ArrayRef(AArch64IntrinsicVariants + {{[0-9]+}}, 8);
+// CHECK: case Intrinsic::aarch64_sve_ld2_sret:
+// CHECK-NEXT: return ArrayRef(AArch64IntrinsicVariants + {{[0-9]+}}, 8);
+// CHECK: case Intrinsic::aarch64_sve_ld4q_sret:
+// CHECK-NEXT: return ArrayRef(AArch64IntrinsicVariants + {{[0-9]+}}, 8);
+// CHECK: case Intrinsic::aarch64_sve_ldnt1:
+// CHECK-NEXT: return ArrayRef(AArch64IntrinsicVariants + {{[0-9]+}}, 8);
+// A single Variant can contain several overload type lists.
+// CHECK: case Intrinsic::aarch64_sve_sel:
+// CHECK-NEXT: return ArrayRef(AArch64IntrinsicVariants + {{[0-9]+}}, 9);
+// CHECK: case Intrinsic::aarch64_sve_st2:
+// CHECK-NEXT: return ArrayRef(AArch64IntrinsicVariants + {{[0-9]+}}, 8);
+// CHECK: case Intrinsic::aarch64_sve_st4q:
+// CHECK-NEXT: return ArrayRef(AArch64IntrinsicVariants + {{[0-9]+}}, 8);
diff --git a/llvm/utils/gn/secondary/clang/include/clang/Basic/BUILD.gn b/llvm/utils/gn/secondary/clang/include/clang/Basic/BUILD.gn
index 24aa125bb8c893..8fba12c0474572 100644
--- a/llvm/utils/gn/secondary/clang/include/clang/Basic/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang/include/clang/Basic/BUILD.gn
@@ -260,7 +260,7 @@ clang_tablegen("arm_sve_builtins") {
 
 clang_tablegen("arm_sve_builtin_cg") {
   args = [ "-gen-arm-sve-builtin-codegen" ]
-  td_file = "arm_sve.td"
+  td_file = "arm_sve_intrinsic_guards.td"
 }
 
 clang_tablegen("arm_sve_typeflags") {
@@ -285,7 +285,7 @@ clang_tablegen("arm_sme_builtins") {
 
 clang_tablegen("arm_sme_builtin_cg") {
   args = [ "-gen-arm-sme-builtin-codegen" ]
-  td_file = "arm_sme.td"
+  td_file = "arm_sme_intrinsic_guards.td"
 }
 
 clang_tablegen("arm_sme_sema_rangechecks") {
diff --git a/llvm/utils/gn/secondary/clang/utils/TableGen/BUILD.gn b/llvm/utils/gn/secondary/clang/utils/TableGen/BUILD.gn
index 8bac3ff18ea55d..358cfdaf61a0ff 100644
--- a/llvm/utils/gn/secondary/clang/utils/TableGen/BUILD.gn
+++ b/llvm/utils/gn/secondary/clang/utils/TableGen/BUILD.gn
@@ -4,6 +4,7 @@ executable("clang-tblgen") {
     "//clang/lib/Support",
     "//llvm/lib/Support",
     "//llvm/lib/TableGen",
+    "//llvm/lib/TargetParser",
   ]
   sources = [
     "ASTTableGen.cpp",
diff --git a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
index bf84c5c8d9cfb0..200f1fda6479f2 100644
--- a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
@@ -54,6 +54,7 @@ cc_binary(
         ":support",
         "//llvm:Support",
         "//llvm:TableGen",
+        "//llvm:TargetParser",
         "//llvm:config",
     ],
 )
@@ -134,9 +135,26 @@ td_library(
         "include/clang/Basic/arm_immcheck_incl.td",
         "include/clang/Basic/arm_mve_defs.td",
         "include/clang/Basic/arm_neon_incl.td",
+        "include/clang/Basic/arm_sme.td",
+        "include/clang/Basic/arm_sve.td",
         "include/clang/Basic/arm_sve_sme_incl.td",
     ],
-    includes = ["include"],
+    includes = [
+        "include",
+        "/clang/include/clang/Basic",
+    ],
+)
+
+td_library(
+    name = "ArmSveIntrinsicGuardsTdFiles",
+    srcs = ["include/clang/Basic/arm_sve_intrinsic_guards.td"],
+    deps = [":ArmTdFiles", "//llvm:CommonTargetTdFiles"],
+)
+
+td_library(
+    name = "ArmSmeIntrinsicGuardsTdFiles",
+    srcs = ["include/clang/Basic/arm_sme_intrinsic_guards.td"],
+    deps = [":ArmTdFiles", "//llvm:CommonTargetTdFiles"],
 )
 
 gentbl_cc_library(
@@ -175,8 +193,8 @@ gentbl_cc_library(
     name = "basic_arm_sve_builtin_cg_gen",
     tbl_outs = {"include/clang/Basic/arm_sve_builtin_cg.inc": ["-gen-arm-sve-builtin-codegen"]},
     tblgen = ":clang-tblgen",
-    td_file = "include/clang/Basic/arm_sve.td",
-    deps = [":ArmTdFiles"],
+    td_file = "include/clang/Basic/arm_sve_intrinsic_guards.td",
+    deps = [":ArmSveIntrinsicGuardsTdFiles"],
 )
 
 gentbl_cc_library(
@@ -223,8 +241,8 @@ gentbl_cc_library(
     name = "basic_arm_sme_builtin_cg_gen",
     tbl_outs = {"include/clang/Basic/arm_sme_builtin_cg.inc": ["-gen-arm-sme-builtin-codegen"]},
     tblgen = ":clang-tblgen",
-    td_file = "include/clang/Basic/arm_sme.td",
-    deps = [":ArmTdFiles"],
+    td_file = "include/clang/Basic/arm_sme_intrinsic_guards.td",
+    deps = [":ArmSmeIntrinsicGuardsTdFiles"],
 )
 
 gentbl_cc_library(

>From 96faa3f7adf561ef1da1ad5838df56ffdda076fd Mon Sep 17 00:00:00 2001
From: Sander de Smalen <sander.desmalen at arm.com>
Date: Tue, 17 Nov 2026 14:17:05 +0000
Subject: [PATCH 2/3] fixup! [AArch64] Add feature guards to SVE and SME
 intrinsics

---
 .../AArch64/AArch64IntrinsicsVerifier.cpp     | 114 +++++++-----------
 .../TableGen/AArch64IntrinsicFeatureChecks.td |  34 ++++--
 2 files changed, 67 insertions(+), 81 deletions(-)

diff --git a/llvm/lib/Target/AArch64/AArch64IntrinsicsVerifier.cpp b/llvm/lib/Target/AArch64/AArch64IntrinsicsVerifier.cpp
index 32a4d63841d846..4b56f4eff5a487 100644
--- a/llvm/lib/Target/AArch64/AArch64IntrinsicsVerifier.cpp
+++ b/llvm/lib/Target/AArch64/AArch64IntrinsicsVerifier.cpp
@@ -10,18 +10,21 @@
 #include "AArch64Subtarget.h"
 #include "AArch64TargetMachine.h"
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SmallVector.h"
 #include "llvm/CodeGen/TargetPassConfig.h"
 #include "llvm/CodeGen/ValueTypes.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/InstIterator.h"
 #include "llvm/IR/InstrTypes.h"
+#include "llvm/IR/IntrinsicFeatureGuard.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/IntrinsicsAArch64.h"
 #include "llvm/IR/Type.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/ErrorHandling.h"
+#include <cassert>
 
 using namespace llvm;
 
@@ -29,93 +32,66 @@ using namespace llvm;
 
 namespace {
 
-struct IntrinsicFeatureGuard {
-  unsigned FirstClause;
-  unsigned NumClauses;
-  const char *Expression;
-};
-
-struct IntrinsicFeatureVariant {
-  unsigned FirstType;
-  unsigned NumResults;
-  unsigned NumInputs;
-  unsigned FirstGuard;
-  unsigned NumGuards;
-  bool AppliesToAllTypes;
-};
-
 #include "AArch64GenIntrinsicFeatureChecks.inc"
 
-static_assert(
-    [] {
-      for (const auto &Variant : AArch64IntrinsicVariants)
-        if (Variant.NumGuards != 2)
-          return false;
-      return true;
-    }(),
-    "AArch64 variants need two mode guards");
-
 // A streaming-compatible function can enter streaming mode with SME. These
 // features are the minimum implied by SME and are available in that mode.
 static constexpr FeatureBitset AArch64StreamingModeFeatures = {
     AArch64::FeatureBF16, AArch64::FeatureFPARMv8, AArch64::FeatureFullFP16,
     AArch64::FeatureNEON, AArch64::FeatureSME};
 
-static bool matchesType(Type *Actual, MVT::SimpleValueType Expected,
-                        const DataLayout &DL) {
-  if (Expected == MVT::iPTR)
+static bool matchesType(Type *Actual, Type *Expected, const DataLayout &DL) {
+  if (Actual == Expected)
+    return true;
+  if (Expected->isPointerTy())
     return Actual->isPointerTy();
-  if (auto *Vector = dyn_cast<VectorType>(Actual)) {
-    if (auto *Pointer = dyn_cast<PointerType>(Vector->getElementType())) {
-      MVT Element = MVT::getIntegerVT(
-          DL.getPointerSizeInBits(Pointer->getAddressSpace()));
-      return MVT::getVectorVT(Element, Vector->getElementCount()) == Expected;
+  if (auto *ActualVector = dyn_cast<VectorType>(Actual)) {
+    if (auto *ExpectedVector = dyn_cast<VectorType>(Expected)) {
+      auto *Pointer = dyn_cast<PointerType>(ActualVector->getElementType());
+      return Pointer &&
+             ExpectedVector->getElementType()->isIntegerTy(
+                 DL.getPointerSizeInBits(Pointer->getAddressSpace())) &&
+             ActualVector->getElementCount() ==
+                 ExpectedVector->getElementCount();
     }
-    if (MVT::getVT(Vector->getElementType(), /*HandleUnknown=*/true) ==
-        MVT::Other)
-      return false;
   }
-  return MVT::getVT(Actual, /*HandleUnknown=*/true) == Expected;
+  if (auto *ActualStruct = dyn_cast<StructType>(Actual)) {
+    if (auto *ExpectedStruct = dyn_cast<StructType>(Expected)) {
+      if (ActualStruct->getNumElements() != ExpectedStruct->getNumElements())
+        return false;
+      for (unsigned I = 0; I < ActualStruct->getNumElements(); ++I)
+        if (!matchesType(ActualStruct->getElementType(I),
+                         ExpectedStruct->getElementType(I), DL))
+          return false;
+      return true;
+    }
+  }
+  return false;
 }
 
 static bool matchesSignature(const IntrinsicInst &Call,
                              const IntrinsicFeatureVariant &V) {
   if (V.AppliesToAllTypes)
     return true;
-  if (Call.arg_size() != V.NumInputs)
+  FunctionType *Expected = getAArch64IntrinsicFunctionType(
+      Call.getContext(), Call.getIntrinsicID(), V);
+  FunctionType *Actual = Call.getFunctionType();
+  if (Actual->getNumParams() != Expected->getNumParams() ||
+      Actual->isVarArg() != Expected->isVarArg())
     return false;
-
-  ArrayRef Types(AArch64IntrinsicTypes + V.FirstType,
-                 V.NumResults + V.NumInputs);
   const DataLayout &DL = Call.getDataLayout();
-  Type *Result = Call.getType();
-  if (V.NumResults == 0) {
-    if (!Result->isVoidTy())
-      return false;
-  } else if (V.NumResults == 1) {
-    if (!matchesType(Result, Types[0], DL))
-      return false;
-  } else {
-    auto *Struct = dyn_cast<StructType>(Result);
-    if (!Struct || Struct->getNumElements() != V.NumResults)
-      return false;
-    for (unsigned I = 0; I < V.NumResults; ++I)
-      if (!matchesType(Struct->getElementType(I), Types[I], DL))
-        return false;
-  }
-
-  for (unsigned I = 0; I < V.NumInputs; ++I)
-    if (!matchesType(Call.getArgOperand(I)->getType(), Types[V.NumResults + I],
-                     DL))
+  if (!matchesType(Actual->getReturnType(), Expected->getReturnType(), DL))
+    return false;
+  for (unsigned I = 0; I < Actual->getNumParams(); ++I)
+    if (!matchesType(Actual->getParamType(I), Expected->getParamType(I), DL))
       return false;
   return true;
 }
 
 static bool hasFeatures(const IntrinsicFeatureGuard &Guard,
                         const FeatureBitset &Available) {
-  for (unsigned I = 0; I < Guard.NumClauses; ++I) {
-    const FeatureBitset &Required =
-        AArch64IntrinsicFeatureClauses[Guard.FirstClause + I];
+  for (const FeatureBitset &Required :
+       getAArch64IntrinsicFeatureAlternatives(Guard)) {
     if ((Available & Required) == Required)
       return true;
   }
@@ -133,7 +109,8 @@ struct IntrinsicCheckResult {
 static IntrinsicCheckResult checkIntrinsic(const IntrinsicInst &II,
                                            const AArch64Subtarget &ST) {
   IntrinsicCheckResult Result;
-  ArrayRef Variants = getAArch64IntrinsicVariants(II.getIntrinsicID());
+  ArrayRef<IntrinsicFeatureVariant> Variants =
+      getAArch64IntrinsicVariants(II.getIntrinsicID());
   if (Variants.empty())
     return Result;
   Result.HasGuards = true;
@@ -145,16 +122,17 @@ static IntrinsicCheckResult checkIntrinsic(const IntrinsicInst &II,
   const FeatureBitset StreamingAvailable =
       BothModes ? Available | AArch64StreamingModeFeatures : Available;
 
-  for (const auto &V : Variants) {
+  for (const IntrinsicFeatureVariant &V : Variants) {
+    assert(V.NumGuards == 2 && "AArch64 variants need two mode guards");
     if (!matchesSignature(II, V))
       continue;
     Result.FoundSignature = true;
     // AArch64 uses guard 0 for non-streaming mode and guard 1 for
     // streaming mode.
-    const auto &NonStreamingGuard = AArch64IntrinsicFeatureGuards
-        [AArch64IntrinsicGuardIndices[V.FirstGuard]];
-    const auto &StreamingGuard = AArch64IntrinsicFeatureGuards
-        [AArch64IntrinsicGuardIndices[V.FirstGuard + 1]];
+    const IntrinsicFeatureGuard &NonStreamingGuard =
+        getAArch64IntrinsicFeatureGuard(V, 0);
+    const IntrinsicFeatureGuard &StreamingGuard =
+        getAArch64IntrinsicFeatureGuard(V, 1);
     if ((!Streaming || BothModes) &&
         !hasFeatures(NonStreamingGuard, Available)) {
       Result.Failed = &NonStreamingGuard;
diff --git a/llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td b/llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td
index 5447aec5583d3f..85c65e73727e7a 100644
--- a/llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td
+++ b/llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td
@@ -4,27 +4,35 @@
 
 // Guards are parsed literally; the verifier supplies the SME base feature.
 // CHECK-NOT: AArch64StreamingModeFeatures
+// CHECK: static ArrayRef<FeatureBitset> getAArch64IntrinsicFeatureAlternatives
+// CHECK-NEXT: static constexpr FeatureBitset AArch64IntrinsicFeatureClauses[] = {
 // CHECK: {AArch64::FeatureSME2p1, AArch64::FeatureSVE},
 // CHECK-NEXT: {AArch64::FeatureSVE, AArch64::FeatureSVE2p1},
 // CHECK: {AArch64::FeatureSVE2},
 // CHECK: {AArch64::FeatureLUT, AArch64::FeatureSME2, AArch64::FeatureSVE},
 // CHECK-NEXT: {AArch64::FeatureLUT, AArch64::FeatureSVE, AArch64::FeatureSVE2},
+// Variants store only the overload types used by Intrinsic::getType().
+// CHECK: static FunctionType *getAArch64IntrinsicFunctionType(
+// CHECK-NEXT: static constexpr MVT::SimpleValueType AArch64IntrinsicOverloadTypes[] = {
+// CHECK: MVT::nxv8bf16, // int_aarch64_sve_fadd
+// CHECK: MVT::nxv4f32, // int_aarch64_sve_fcvt_x2
+// CHECK: MVT::nxv2i64, MVT::nxv2f64, // int_aarch64_sve_fcvtzs
+// CHECK: MVT::nxv16i8, MVT::iPTR, // int_aarch64_sve_ld2_sret
+// CHECK: MVT::iPTR, MVT::nxv2i64, // int_aarch64_sve_prfb_gather_index
+// CHECK: MVT::nxv16i1, // int_aarch64_sve_punpkhi
+// CHECK: MVT::nxv16i8, MVT::iPTR, // int_aarch64_sve_st4
+// CHECK: return Intrinsic::getType(Context, ID, OverloadTypes);
+// CHECK: static const IntrinsicFeatureGuard &getAArch64IntrinsicFeatureGuard
+// CHECK-NEXT: static constexpr unsigned AArch64IntrinsicGuardIndices[] = {
+// A streaming-compatible ZT0 intrinsic explicitly uses SME2 in both modes.
+// CHECK: [[ZT_GUARD:[0-9]+]], [[ZT_GUARD]], // int_aarch64_sme_ldr_zt
+// CHECK: static constexpr IntrinsicFeatureGuard AArch64IntrinsicFeatureGuards[] = {
 // CHECK: 2, "sve,(sve2p1|sme2p1)"},
 // CHECK-NEXT: {{.*}}"sve2p1|sme2p1"},
 // CHECK: 2, "sve,(sve2|sme2),lut"},
-
-// Overload-only variants expand to complete result and operand signatures.
-// CHECK: MVT::i64, MVT::i32, // int_aarch64_sve_cntb
-// CHECK: MVT::nxv8bf16, MVT::nxv8i1, MVT::nxv8bf16, MVT::nxv8bf16, // int_aarch64_sve_fadd
-// CHECK: MVT::nxv8f16, MVT::nxv4f32, MVT::nxv4f32, // int_aarch64_sve_fcvt_x2
-// CHECK: MVT::nxv2i64, MVT::nxv2i64, MVT::nxv2i1, MVT::nxv2f64, // int_aarch64_sve_fcvtzs
-// CHECK: MVT::nxv16i8, MVT::nxv16i8, MVT::nxv16i1, MVT::iPTR, // int_aarch64_sve_ld2_sret
-// CHECK: MVT::nxv2i1, MVT::iPTR, MVT::nxv2i64, MVT::i32, // int_aarch64_sve_prfb_gather_index
-// CHECK: MVT::nxv8i1, MVT::nxv16i1, // int_aarch64_sve_punpkhi
-// CHECK: MVT::nxv16i8, MVT::nxv16i8, MVT::nxv16i8, MVT::nxv16i8, MVT::nxv16i1, MVT::iPTR, // int_aarch64_sve_st4
-// A streaming-compatible ZT0 intrinsic explicitly uses SME2 in both modes.
-// CHECK: [[ZT_GUARD:[0-9]+]], [[ZT_GUARD]], // int_aarch64_sme_ldr_zt
-// CHECK: {{[0-9]+}}, 0, 2, {{[0-9]+}}, 2, false}, // int_aarch64_sme_ldr_zt
+// CHECK: static ArrayRef<IntrinsicFeatureVariant> getAArch64IntrinsicVariants
+// CHECK-NEXT: static constexpr IntrinsicFeatureVariant AArch64IntrinsicVariants[] = {
+// CHECK: {{[0-9]+}}, 1, {{[0-9]+}}, 2, false}, // int_aarch64_sme_ldr_zt
 // CHECK: case Intrinsic::aarch64_sve_fadd:
 // CHECK-NEXT: return ArrayRef(AArch64IntrinsicVariants + {{[0-9]+}}, 4);
 // The contiguous load and store helpers preserve each tuple width.

>From 9c16de3ad9d7c6faf957601a263ffd2a5129695a Mon Sep 17 00:00:00 2001
From: Sander de Smalen <sander.desmalen at arm.com>
Date: Tue, 17 Nov 2026 17:10:40 +0000
Subject: [PATCH 3/3] fixup! [AArch64] Add feature guards to SVE and SME
 intrinsics

Check that the AArch64 generated table marks each lookup function
[[maybe_unused]], matching the TableGen emitter change.

Generate AArch64GenIntrinsicFeatureChecks.inc in the Bazel AArch64 target so
the intrinsic verifier can include it. Format the Clang SVE/SME guard rules
as required by Buildifier.
---
 llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td |  8 ++++----
 utils/bazel/llvm-project-overlay/clang/BUILD.bazel  | 12 +++++++++---
 utils/bazel/llvm-project-overlay/llvm/BUILD.bazel   |  8 ++++++++
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td b/llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td
index 85c65e73727e7a..60cfa9c05da521 100644
--- a/llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td
+++ b/llvm/test/TableGen/AArch64IntrinsicFeatureChecks.td
@@ -4,7 +4,7 @@
 
 // Guards are parsed literally; the verifier supplies the SME base feature.
 // CHECK-NOT: AArch64StreamingModeFeatures
-// CHECK: static ArrayRef<FeatureBitset> getAArch64IntrinsicFeatureAlternatives
+// CHECK: {{\[\[}}maybe_unused{{\]\]}} static ArrayRef<FeatureBitset> getAArch64IntrinsicFeatureAlternatives
 // CHECK-NEXT: static constexpr FeatureBitset AArch64IntrinsicFeatureClauses[] = {
 // CHECK: {AArch64::FeatureSME2p1, AArch64::FeatureSVE},
 // CHECK-NEXT: {AArch64::FeatureSVE, AArch64::FeatureSVE2p1},
@@ -12,7 +12,7 @@
 // CHECK: {AArch64::FeatureLUT, AArch64::FeatureSME2, AArch64::FeatureSVE},
 // CHECK-NEXT: {AArch64::FeatureLUT, AArch64::FeatureSVE, AArch64::FeatureSVE2},
 // Variants store only the overload types used by Intrinsic::getType().
-// CHECK: static FunctionType *getAArch64IntrinsicFunctionType(
+// CHECK: {{\[\[}}maybe_unused{{\]\]}} static FunctionType *getAArch64IntrinsicFunctionType(
 // CHECK-NEXT: static constexpr MVT::SimpleValueType AArch64IntrinsicOverloadTypes[] = {
 // CHECK: MVT::nxv8bf16, // int_aarch64_sve_fadd
 // CHECK: MVT::nxv4f32, // int_aarch64_sve_fcvt_x2
@@ -22,7 +22,7 @@
 // CHECK: MVT::nxv16i1, // int_aarch64_sve_punpkhi
 // CHECK: MVT::nxv16i8, MVT::iPTR, // int_aarch64_sve_st4
 // CHECK: return Intrinsic::getType(Context, ID, OverloadTypes);
-// CHECK: static const IntrinsicFeatureGuard &getAArch64IntrinsicFeatureGuard
+// CHECK: {{\[\[}}maybe_unused{{\]\]}} static const IntrinsicFeatureGuard &getAArch64IntrinsicFeatureGuard
 // CHECK-NEXT: static constexpr unsigned AArch64IntrinsicGuardIndices[] = {
 // A streaming-compatible ZT0 intrinsic explicitly uses SME2 in both modes.
 // CHECK: [[ZT_GUARD:[0-9]+]], [[ZT_GUARD]], // int_aarch64_sme_ldr_zt
@@ -30,7 +30,7 @@
 // CHECK: 2, "sve,(sve2p1|sme2p1)"},
 // CHECK-NEXT: {{.*}}"sve2p1|sme2p1"},
 // CHECK: 2, "sve,(sve2|sme2),lut"},
-// CHECK: static ArrayRef<IntrinsicFeatureVariant> getAArch64IntrinsicVariants
+// CHECK: {{\[\[}}maybe_unused{{\]\]}} static ArrayRef<IntrinsicFeatureVariant> getAArch64IntrinsicVariants
 // CHECK-NEXT: static constexpr IntrinsicFeatureVariant AArch64IntrinsicVariants[] = {
 // CHECK: {{[0-9]+}}, 1, {{[0-9]+}}, 2, false}, // int_aarch64_sme_ldr_zt
 // CHECK: case Intrinsic::aarch64_sve_fadd:
diff --git a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
index 200f1fda6479f2..279c59464d2cb5 100644
--- a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
@@ -140,21 +140,27 @@ td_library(
         "include/clang/Basic/arm_sve_sme_incl.td",
     ],
     includes = [
-        "include",
         "/clang/include/clang/Basic",
+        "include",
     ],
 )
 
 td_library(
     name = "ArmSveIntrinsicGuardsTdFiles",
     srcs = ["include/clang/Basic/arm_sve_intrinsic_guards.td"],
-    deps = [":ArmTdFiles", "//llvm:CommonTargetTdFiles"],
+    deps = [
+        ":ArmTdFiles",
+        "//llvm:CommonTargetTdFiles",
+    ],
 )
 
 td_library(
     name = "ArmSmeIntrinsicGuardsTdFiles",
     srcs = ["include/clang/Basic/arm_sme_intrinsic_guards.td"],
-    deps = [":ArmTdFiles", "//llvm:CommonTargetTdFiles"],
+    deps = [
+        ":ArmTdFiles",
+        "//llvm:CommonTargetTdFiles",
+    ],
 )
 
 gentbl_cc_library(
diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
index 5fc8793314c398..90ce98475c6203 100644
--- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
@@ -2738,6 +2738,14 @@ llvm_target_lib_list = [lib for lib in [
                 ["-gen-instr-info"],
                 "lib/Target/AArch64/AArch64GenInstrInfo.inc",
             ),
+            (
+                [
+                    "-gen-intrinsic-feature-checks",
+                    "-intrinsic-feature-prefix=aarch64",
+                    "-intrinsic-feature-namespace=AArch64",
+                ],
+                "lib/Target/AArch64/AArch64GenIntrinsicFeatureChecks.inc",
+            ),
             (
                 ["-gen-emitter"],
                 "lib/Target/AArch64/AArch64GenMCCodeEmitter.inc",



More information about the llvm-branch-commits mailing list