Skip to content

Commit 81660bb

Browse files
[AArch64] remove pointless AEK_NONE (#97569)
1 parent 94b2b1d commit 81660bb

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

llvm/unittests/TargetParser/TargetParserTest.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ std::string FormatExtensionFlags(int64_t Flags) {
6868

6969
std::string FormatExtensionFlags(AArch64::ExtensionBitset Flags) {
7070
std::vector<StringRef> Features;
71-
72-
// AEK_NONE is not meant to be shown to the user so the target parser
73-
// does not recognise it. It is relevant here though.
74-
if (Flags.test(AArch64::AEK_NONE))
75-
Features.push_back("none");
7671
AArch64::getExtensionFeatures(Flags, Features);
7772

7873
// The target parser also includes every extension you don't have.
@@ -2009,10 +2004,9 @@ TEST(TargetParserTest, AArch64ExtensionFeatures) {
20092004
for (auto Ext : Extensions)
20102005
ExtVal.set(Ext);
20112006

2012-
// NONE has no feature names.
2013-
// We return True here because NONE is a valid choice.
2014-
EXPECT_TRUE(AArch64::getExtensionFeatures({AArch64::AEK_NONE}, Features));
2015-
EXPECT_TRUE(!Features.size());
2007+
// Test an empty set of features.
2008+
EXPECT_TRUE(AArch64::getExtensionFeatures({}, Features));
2009+
EXPECT_TRUE(Features.size() == 0);
20162010

20172011
AArch64::getExtensionFeatures(ExtVal, Features);
20182012
EXPECT_EQ(Extensions.size(), Features.size());
@@ -2092,8 +2086,7 @@ TEST(TargetParserTest, AArch64ExtensionFeatures) {
20922086
EXPECT_TRUE(llvm::is_contained(Features, "+complxnum"));
20932087

20942088
// Assuming we listed every extension above, this should produce the same
2095-
// result. (note that AEK_NONE doesn't have a name so it won't be in the
2096-
// result despite its bit being set)
2089+
// result.
20972090
std::vector<StringRef> AllFeatures;
20982091
EXPECT_TRUE(AArch64::getExtensionFeatures(ExtVal, AllFeatures));
20992092
EXPECT_THAT(Features, ::testing::ContainerEq(AllFeatures));

llvm/utils/TableGen/ARMTargetDefEmitter.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,10 @@ static void EmitARMTargetDef(RecordKeeper &RK, raw_ostream &OS) {
7878

7979
// Emit the ArchExtKind enum
8080
OS << "#ifdef EMIT_ARCHEXTKIND_ENUM\n"
81-
<< "enum ArchExtKind : unsigned {\n"
82-
<< " AEK_NONE = 1,\n";
81+
<< "enum ArchExtKind : unsigned {\n";
8382
for (const Record *Rec : SortedExtensions) {
8483
auto AEK = Rec->getValueAsString("ArchExtKindSpelling").upper();
85-
if (AEK != "AEK_NONE")
86-
OS << " " << AEK << ",\n";
84+
OS << " " << AEK << ",\n";
8785
}
8886
OS << " AEK_NUM_EXTENSIONS\n"
8987
<< "};\n"
@@ -108,7 +106,6 @@ static void EmitARMTargetDef(RecordKeeper &RK, raw_ostream &OS) {
108106
OS << ", \"-" << Rec->getValueAsString("Name") << "\""; // negfeature
109107
OS << "},\n";
110108
};
111-
OS << " {\"none\", {}, AArch64::AEK_NONE, {}, {}, {}, {} },\n";
112109
OS << "};\n"
113110
<< "#undef EMIT_EXTENSIONS\n"
114111
<< "#endif // EMIT_EXTENSIONS\n"

0 commit comments

Comments
 (0)