Skip to content

Commit

Permalink
[NFC] Add Extension Lookup to AArch64TargetParser
Browse files Browse the repository at this point in the history
Currently, an extension cannot be found using the ExtID. To address this,
the function `lookupExtensionByID` has been added to the `ExtensionSet`
Class so it can be targeted from outside the function.

This will allow for the Extensions Information to be searched for and
stored externally to the ExtensionSet Class. This enables being able to
search for if Architecture Features have been enabled by the user in the
command line.
  • Loading branch information
Stylie777 committed Apr 30, 2024
1 parent 2524146 commit b21ee48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llvm/include/llvm/TargetParser/AArch64TargetParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,8 @@ inline constexpr Alias CpuAliases[] = {{"cobalt-100", "neoverse-n2"},

inline constexpr Alias ExtAliases[] = {{"rdma", "rdm"}};

const ExtensionInfo &getExtensionByID(ArchExtKind(ExtID));

bool getExtensionFeatures(
const AArch64::ExtensionBitset &Extensions,
std::vector<StringRef> &Features);
Expand Down
5 changes: 5 additions & 0 deletions llvm/lib/TargetParser/AArch64TargetParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,8 @@ bool AArch64::ExtensionSet::parseModifier(StringRef Modifier) {
}
return false;
}

const AArch64::ExtensionInfo &
AArch64::getExtensionByID(AArch64::ArchExtKind ExtID) {
return lookupExtensionByID(ExtID);
}

0 comments on commit b21ee48

Please sign in to comment.