diff options
| author | Alex Lorenz <arphaman@gmail.com> | 2021-05-03 20:05:38 -0700 |
|---|---|---|
| committer | Alex Lorenz <arphaman@gmail.com> | 2021-05-03 20:07:00 -0700 |
| commit | 2669abaecfc47d4d2436559ab8c1fb49ad6e35c3 (patch) | |
| tree | a76d9431d64b7fb20508f5619d4ecc4cdc1918a3 /clang/lib/CodeGen/CodeGenModule.cpp | |
| parent | aa58281979710a1cee6f1635dc1074c4dfc44650 (diff) | |
[clang][CodeGen] Use llvm::stable_sort for multi version resolver options
The use of llvm::sort causes periodic failures on the bot with EXPENSIVE_CHECKS enabled,
as the regular sort pre-shuffles the array in the expensive checks mode, leading to a
non-deterministic test result which causes the CodeGenCXX/attr-cpuspecific-outoflinedefs.cpp
testcase to fail on the bot (http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/).
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 8d4a0e0855b1..cb0523898c3a 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3344,7 +3344,7 @@ void CodeGenModule::emitCPUDispatchDefinition(GlobalDecl GD) { ++Index; } - llvm::sort( + llvm::stable_sort( Options, [](const CodeGenFunction::MultiVersionResolverOption &LHS, const CodeGenFunction::MultiVersionResolverOption &RHS) { return CodeGenFunction::GetX86CpuSupportsMask(LHS.Conditions.Features) > |
