================ @@ -1694,6 +1697,61 @@ 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(); + }); + + switch (Kind) { ---------------- sdesmalen-arm wrote:
nit: Rather than having two of these switch statements, you could do: ``` StringRef ExtensionKind; switch (Kind) { case ACLEKind::SME: ExtensionKind = "SME"; break; case ACLEKind::SVE: ExtensionKind = "SVE"; break; } OS << "#ifdef GET_" << ExtensionKind << "_STREAMING_ATTRS\n"; ... for (...) { ... OS << "case " << ExtensionKind << "::BI_builtin_" << ExtensionKind.lower() << "_"; ... } ``` https://github.com/llvm/llvm-project/pull/74064 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits