Skip to content

Commit e069bb7

Browse files
committed
[RISCV] Use map::count instead of hasExtension in RISCVISAInfo::updateCombination. NFC
hasExtension check isSupportedExtension before the map lookup. All of the extensions we check for in updateCombination should be valid extension names so we can bypass that to save some time.
1 parent 427beff commit e069bb7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/TargetParser/RISCVISAInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ void RISCVISAInfo::updateCombination() {
890890
do {
891891
MadeChange = false;
892892
for (StringRef CombineExt : CombineIntoExts) {
893-
if (hasExtension(CombineExt))
893+
if (Exts.count(CombineExt.str()))
894894
continue;
895895

896896
// Look up the extension in the ImpliesExt table to find everything it
@@ -899,7 +899,7 @@ void RISCVISAInfo::updateCombination() {
899899
std::end(ImpliedExts), CombineExt);
900900
bool HasAllRequiredFeatures = std::all_of(
901901
Range.first, Range.second, [&](const ImpliedExtsEntry &Implied) {
902-
return hasExtension(Implied.ImpliedExt);
902+
return Exts.count(Implied.ImpliedExt);
903903
});
904904
if (HasAllRequiredFeatures) {
905905
auto Version = findDefaultVersion(CombineExt);

0 commit comments

Comments
 (0)