[clang] [llvm] [NFC][clang][FMV][TargetInfo] Refactor API for FMV feature priority. (PR #116257)
Alexandros Lamprineas via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 27 07:11:20 PST 2024
================
@@ -2938,36 +2914,17 @@ void CodeGenFunction::EmitRISCVMultiVersionResolver(
bool HasDefault = false;
unsigned DefaultIndex = 0;
- SmallVector<CodeGenFunction::MultiVersionResolverOption, 10> CurrOptions(
- Options);
-
- llvm::stable_sort(
- CurrOptions, [](const CodeGenFunction::MultiVersionResolverOption &LHS,
- const CodeGenFunction::MultiVersionResolverOption &RHS) {
- return getPriorityFromAttrString(LHS.Conditions.Features[0]) >
- getPriorityFromAttrString(RHS.Conditions.Features[0]);
- });
-
// Check the each candidate function.
- for (unsigned Index = 0; Index < CurrOptions.size(); Index++) {
+ for (unsigned Index = 0; Index < Options.size(); Index++) {
- if (CurrOptions[Index].Conditions.Features[0].starts_with("default")) {
+ if (Options[Index].Features.empty()) {
HasDefault = true;
DefaultIndex = Index;
continue;
}
Builder.SetInsertPoint(CurBlock);
- std::vector<std::string> TargetAttrFeats =
- getContext()
- .getTargetInfo()
- .parseTargetAttr(CurrOptions[Index].Conditions.Features[0])
----------------
labrinea wrote:
I am using parseTargetAttr in latest revision, which had to be adapted for already delimited strings.
https://github.com/llvm/llvm-project/pull/116257
More information about the cfe-commits
mailing list