FunctionSpecialization: Make the ordering of BestSpecs stricter
otherwise it's not guaranteed which of two candidates with the same score would get specialized first, or at all.
This commit is contained in:
parent
0e346eeac6
commit
575e68e571
@ -689,7 +689,9 @@ bool FunctionSpecializer::run() {
|
||||
// specialization budget, which is derived from maximum number of
|
||||
// specializations per specialization candidate function.
|
||||
auto CompareScore = [&AllSpecs](unsigned I, unsigned J) {
|
||||
return AllSpecs[I].Score > AllSpecs[J].Score;
|
||||
if (AllSpecs[I].Score != AllSpecs[J].Score)
|
||||
return AllSpecs[I].Score > AllSpecs[J].Score;
|
||||
return I > J;
|
||||
};
|
||||
const unsigned NSpecs =
|
||||
std::min(NumCandidates * MaxClones, unsigned(AllSpecs.size()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user