[clang] [AArch64][SME] Warn when using a streaming builtin from a non-streaming function (PR #75487)
Sander de Smalen via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 15 05:55:24 PST 2023
================
@@ -1702,6 +1705,62 @@ void SVEEmitter::createSMERangeChecks(raw_ostream &OS) {
OS << "#endif\n\n";
}
+void SVEEmitter::createStreamingAttrs(raw_ostream &OS, ACLEKind Kind) {
+ std::vector<Record *> RV = Records.getAllDerivedDefinitions("Inst");
+ SmallVector<std::unique_ptr<Intrinsic>, 128> Defs;
+ for (auto *R : RV)
+ createIntrinsic(R, Defs);
+
+ // The mappings must be sorted based on BuiltinID.
+ llvm::sort(Defs, [](const std::unique_ptr<Intrinsic> &A,
+ const std::unique_ptr<Intrinsic> &B) {
+ return A->getMangledName() < B->getMangledName();
+ });
+
+ StringRef ExtensionKind;
+ switch (Kind) {
+ case ACLEKind::SME:
+ ExtensionKind = "SME";
+ break;
+ case ACLEKind::SVE:
+ ExtensionKind = "SVE";
+ break;
+ }
+
+ OS << "#ifdef GET_" << ExtensionKind << "_STREAMING_ATTRS\n";
+
+ // Ensure these are only emitted once.
+ std::set<std::string> Emitted;
+ llvm::StringMap<std::set<std::string>> StreamingMap;
----------------
sdesmalen-arm wrote:
If you're using a `std::set` here, there is no need for sorting the Defs and also no need for `std::set<..> Emitted`
https://github.com/llvm/llvm-project/pull/75487
More information about the cfe-commits
mailing list