[llvm] 81660bb - [AArch64] remove pointless AEK_NONE (#97569)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 4 02:47:11 PDT 2024
Author: Tomas Matheson
Date: 2024-07-04T10:47:07+01:00
New Revision: 81660bbc1c066646ef3c232f5af097092e76f8b7
URL: https://github.com/llvm/llvm-project/commit/81660bbc1c066646ef3c232f5af097092e76f8b7
DIFF: https://github.com/llvm/llvm-project/commit/81660bbc1c066646ef3c232f5af097092e76f8b7.diff
LOG: [AArch64] remove pointless AEK_NONE (#97569)
Added:
Modified:
llvm/unittests/TargetParser/TargetParserTest.cpp
llvm/utils/TableGen/ARMTargetDefEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/TargetParser/TargetParserTest.cpp b/llvm/unittests/TargetParser/TargetParserTest.cpp
index 97d09d677fbdd..d1c3dcb2f8ee4 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.
@@ -2009,10 +2004,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::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());
@@ -2092,8 +2086,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