[PATCH] D152800: [MISched][scheduleDump] Use stable_sort to prevent test failures.

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 05:44:01 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG623295a1d0cc: [MISched][scheduleDump] Use stable_sort to prevent test failures. (authored by fpetrogalli).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152800/new/

https://reviews.llvm.org/D152800

Files:
  llvm/lib/CodeGen/MachineScheduler.cpp


Index: llvm/lib/CodeGen/MachineScheduler.cpp
===================================================================
--- llvm/lib/CodeGen/MachineScheduler.cpp
+++ llvm/lib/CodeGen/MachineScheduler.cpp
@@ -1010,13 +1010,13 @@
                    SchedModel.getWriteProcResEnd(SC)));
 
     if (MISchedSortResourcesInTrace)
-      llvm::sort(ResourcesIt.begin(), ResourcesIt.end(),
-                 [](const MCWriteProcResEntry &LHS,
-                    const MCWriteProcResEntry &RHS) -> bool {
-                   return LHS.StartAtCycle < RHS.StartAtCycle ||
-                          (LHS.StartAtCycle == RHS.StartAtCycle &&
-                           LHS.Cycles < RHS.Cycles);
-                 });
+      llvm::stable_sort(ResourcesIt,
+                        [](const MCWriteProcResEntry &LHS,
+                           const MCWriteProcResEntry &RHS) -> bool {
+                          return LHS.StartAtCycle < RHS.StartAtCycle ||
+                                 (LHS.StartAtCycle == RHS.StartAtCycle &&
+                                  LHS.Cycles < RHS.Cycles);
+                        });
     for (const MCWriteProcResEntry &PI : ResourcesIt) {
       C = FirstCycle;
       const std::string ResName =
@@ -1090,13 +1090,13 @@
                    SchedModel.getWriteProcResEnd(SC)));
 
     if (MISchedSortResourcesInTrace)
-      llvm::sort(ResourcesIt.begin(), ResourcesIt.end(),
-                 [](const MCWriteProcResEntry &LHS,
-                    const MCWriteProcResEntry &RHS) -> bool {
-                   return LHS.StartAtCycle < RHS.StartAtCycle ||
-                          (LHS.StartAtCycle == RHS.StartAtCycle &&
-                           LHS.Cycles < RHS.Cycles);
-                 });
+      llvm::stable_sort(ResourcesIt,
+                        [](const MCWriteProcResEntry &LHS,
+                           const MCWriteProcResEntry &RHS) -> bool {
+                          return LHS.StartAtCycle < RHS.StartAtCycle ||
+                                 (LHS.StartAtCycle == RHS.StartAtCycle &&
+                                  LHS.Cycles < RHS.Cycles);
+                        });
     for (const MCWriteProcResEntry &PI : ResourcesIt) {
       C = FirstCycle;
       const std::string ResName =


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152800.530879.patch
Type: text/x-patch
Size: 2249 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230613/9727f73e/attachment.bin>


More information about the llvm-commits mailing list