[MISched][scheduleDump] Use stable_sort to prevent test failures.
authorFrancesco Petrogalli <francesco.petrogalli@apple.com>
Tue, 13 Jun 2023 12:04:05 +0000 (14:04 +0200)
committerFrancesco Petrogalli <francesco.petrogalli@apple.com>
Tue, 13 Jun 2023 12:40:29 +0000 (14:40 +0200)
commit623295a1d0cc8d0ace354b1b97959df49be8a86e
treed802846b9c001bf866d6ac6ec593cf28ec6979ce
parent8d1edae998fb40bbb22c5b5146eb333cf6148b35
[MISched][scheduleDump] Use stable_sort to prevent test failures.

When building the compiler with -DLLVM_ENABLE_EXPENSIVE_CHECKS=ON,
sometimes resources that are dumped in scheduled traces gets reordered
even if they are booked in the same cycle. Using `stable_sort`
guarantees that such occasional reordering does not happen.

This change should fix failures like the one seen in
https://lab.llvm.org/buildbot/#/builders/16/builds/49592.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D152800
llvm/lib/CodeGen/MachineScheduler.cpp