llvm::stable_sort is apparently not sufficient.
Use the same tie-breaker/sorting style as TopoOrderRC fix bot failures.
E.g.
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/19401/steps/test-check-all/logs/stdio
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370267
91177308-0d34-0410-b5e6-
96231b3b80d8
// Find and return the largest of our candidate classes.
llvm::stable_sort(Candidates, [&](const CodeGenRegisterClass *A,
const CodeGenRegisterClass *B) {
- return A->getMembers().size() > B->getMembers().size();
+ if (A->getMembers().size() > B->getMembers().size())
+ return true;
+
+ if (A->getMembers().size() < B->getMembers().size())
+ return false;
+
+ // Order by name as a tie-breaker.
+ return StringRef(A->getName()) < B->getName();
});
return Candidates[0];