[llvm] [AArch64] remove pointless AEK_NONE (PR #97569)
Tomas Matheson via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 3 06:00:15 PDT 2024
https://github.com/tmatheson-arm created https://github.com/llvm/llvm-project/pull/97569
None
>From d03f20059551d22e538e96e0c694044ab507d770 Mon Sep 17 00:00:00 2001
From: Tomas Matheson <tomas.matheson at arm.com>
Date: Wed, 3 Jul 2024 13:56:48 +0100
Subject: [PATCH] [AArch64] remove pointless AEK_NONE
---
llvm/unittests/TargetParser/TargetParserTest.cpp | 16 ++++------------
llvm/utils/TableGen/ARMTargetDefEmitter.cpp | 7 ++-----
2 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/llvm/unittests/TargetParser/TargetParserTest.cpp b/llvm/unittests/TargetParser/TargetParserTest.cpp
index fe20099382859..89407fc338197 100644
--- a/llvm/unittests/TargetParser/TargetParserTest.cpp
+++ b/llvm/unittests/TargetParser/TargetParserTest.cpp
@@ -68,11 +68,6 @@ std::string FormatExtensionFlags(int64_t Flags) {
std::string FormatExtensionFlags(AArch64::ExtensionBitset Flags) {
std::vector<StringRef> Features;
-
- // AEK_NONE is not meant to be shown to the user so the target parser
- // does not recognise it. It is relevant here though.
- if (Flags.test(AArch64::AEK_NONE))
- Features.push_back("none");
AArch64::getExtensionFeatures(Flags, Features);
// The target parser also includes every extension you don't have.
@@ -2146,11 +2141,9 @@ TEST(TargetParserTest, AArch64ExtensionFeatures) {
for (auto Ext : Extensions)
ExtVal.set(Ext);
- // NONE has no feature names.
- // We return True here because NONE is a valid choice.
- EXPECT_TRUE(AArch64::getExtensionFeatures(
- AArch64::ExtensionBitset({AArch64::AEK_NONE}), Features));
- EXPECT_TRUE(!Features.size());
+ // Test an empty set of features.
+ EXPECT_TRUE(AArch64::getExtensionFeatures({}, Features));
+ EXPECT_TRUE(Features.size() == 0);
AArch64::getExtensionFeatures(ExtVal, Features);
EXPECT_EQ(Extensions.size(), Features.size());
@@ -2230,8 +2223,7 @@ TEST(TargetParserTest, AArch64ExtensionFeatures) {
EXPECT_TRUE(llvm::is_contained(Features, "+complxnum"));
// Assuming we listed every extension above, this should produce the same
- // result. (note that AEK_NONE doesn't have a name so it won't be in the
- // result despite its bit being set)
+ // result.
std::vector<StringRef> AllFeatures;
EXPECT_TRUE(AArch64::getExtensionFeatures(ExtVal, AllFeatures));
EXPECT_THAT(Features, ::testing::ContainerEq(AllFeatures));
diff --git a/llvm/utils/TableGen/ARMTargetDefEmitter.cpp b/llvm/utils/TableGen/ARMTargetDefEmitter.cpp
index 1435696a5d42f..a4b25025b3c61 100644
--- a/llvm/utils/TableGen/ARMTargetDefEmitter.cpp
+++ b/llvm/utils/TableGen/ARMTargetDefEmitter.cpp
@@ -78,12 +78,10 @@ static void EmitARMTargetDef(RecordKeeper &RK, raw_ostream &OS) {
// Emit the ArchExtKind enum
OS << "#ifdef EMIT_ARCHEXTKIND_ENUM\n"
- << "enum ArchExtKind : unsigned {\n"
- << " AEK_NONE = 1,\n";
+ << "enum ArchExtKind : unsigned {\n";
for (const Record *Rec : SortedExtensions) {
auto AEK = Rec->getValueAsString("ArchExtKindSpelling").upper();
- if (AEK != "AEK_NONE")
- OS << " " << AEK << ",\n";
+ OS << " " << AEK << ",\n";
}
OS << " AEK_NUM_EXTENSIONS\n"
<< "};\n"
@@ -108,7 +106,6 @@ static void EmitARMTargetDef(RecordKeeper &RK, raw_ostream &OS) {
OS << ", \"-" << Rec->getValueAsString("Name") << "\""; // negfeature
OS << "},\n";
};
- OS << " {\"none\", {}, AArch64::AEK_NONE, {}, {}, {}, {} },\n";
OS << "};\n"
<< "#undef EMIT_EXTENSIONS\n"
<< "#endif // EMIT_EXTENSIONS\n"
More information about the llvm-commits
mailing list