This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Sort the extensions in SupportedExtensions and SupportedExperimentalExtensions.
ClosedPublic

Authored by craig.topper on Jun 16 2023, 2:22 PM.

Details

Summary

As the extension list continues to grow it probably makes sense
to use a binary search rather than linear search. Sorting the strings
will make this possible.

This also avoids any question about where to add new strings in
the tables.

Diff Detail

Event Timeline

craig.topper created this revision.Jun 16 2023, 2:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2023, 2:22 PM
craig.topper requested review of this revision.Jun 16 2023, 2:22 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 16 2023, 2:22 PM
asb accepted this revision.Jun 22 2023, 6:55 AM

LGTM.

This revision is now accepted and ready to land.Jun 22 2023, 6:55 AM

Can we have an expensive check that the table is sorted?

Can we have an expensive check that the table is sorted?

Yeah. I was going to do it when I made use of the sorted property, but it makes more sense to be in this patch. I'll probably do it for asserts builds for a better chance of people catching the error before it goes to the build bots.

Verify the table is sorted. This uses the same pattern we use to check sorted tables in other places like X86InstrFMA3Info.cpp.

asb added a comment.Jun 22 2023, 10:55 AM

OK, if this patch is going to verify the table is sorted then SupportedExtensions and SupportedExperimentalExtensions probably deserve a comment to explicitly note they must be kept in sort order. Otherwise, still LGTM.

This revision was landed with ongoing or failed builds.Jun 22 2023, 11:26 AM
This revision was automatically updated to reflect the committed changes.