[clang] [Clang][AArch64] Fix checkArmStreamingBuiltin for 'sve-b16b16' (PR #109420)
Paul Walker via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 3 02:42:23 PDT 2024
================
@@ -953,9 +953,20 @@ Intrinsic::Intrinsic(StringRef Name, StringRef Proto, uint64_t MergeTy,
SVEEmitter &Emitter, StringRef SVEGuard,
StringRef SMEGuard)
: Name(Name.str()), LLVMName(LLVMName), Proto(Proto.str()),
- BaseTypeSpec(BT), Class(Class), SVEGuard(SVEGuard.str()),
- SMEGuard(SMEGuard.str()), MergeSuffix(MergeSuffix.str()),
+ BaseTypeSpec(BT), Class(Class), MergeSuffix(MergeSuffix.str()),
BaseType(BT, 'd'), Flags(Flags), ImmChecks(Checks) {
+
+ auto FormatGuard = [](StringRef Guard, StringRef Base) -> std::string {
+ if (Guard.empty() || Guard == Base || Guard.starts_with(Base.str() + ","))
+ return Guard.str();
+ if (Guard.contains('|'))
+ return Base.str() + ",(" + Guard.str() + ")";
----------------
paulwalker-arm wrote:
Would it be safer if this check was first? Or more specifically before the `Guard.starts_with...` test? Consider `sve,sve-optional|sve2`.
https://github.com/llvm/llvm-project/pull/109420
More information about the cfe-commits
mailing list