diff options
author | Kazu Hirata <kazu@google.com> | 2025-06-29 08:25:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-29 08:25:53 -0700 |
commit | 43ab5bb92115c8fd02e5da030a13b4ae1f83cb0a (patch) | |
tree | 0e742fc95566cc64ca7f25ee548db2e4e2ff29b0 /llvm/lib/CodeGen/MachineScheduler.cpp | |
parent | d2d5203bf48af9b55b8e379c1c152fec97349340 (diff) | |
download | llvm-43ab5bb92115c8fd02e5da030a13b4ae1f83cb0a.zip llvm-43ab5bb92115c8fd02e5da030a13b4ae1f83cb0a.tar.gz llvm-43ab5bb92115c8fd02e5da030a13b4ae1f83cb0a.tar.bz2 |
[CodeGen] Use std::tie to implement a comparison functor (NFC) (#146252)
std::tie clearly expresses the intent while slightly shortening the
code.
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineScheduler.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp index 7b4f29e..76cba29 100644 --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/lib/CodeGen/MachineScheduler.cpp @@ -1290,13 +1290,13 @@ LLVM_DUMP_METHOD void ScheduleDAGMI::dumpScheduleTraceTopDown() const { SchedModel.getWriteProcResEnd(SC))); if (MISchedSortResourcesInTrace) - llvm::stable_sort(ResourcesIt, - [](const MCWriteProcResEntry &LHS, - const MCWriteProcResEntry &RHS) -> bool { - return LHS.AcquireAtCycle < RHS.AcquireAtCycle || - (LHS.AcquireAtCycle == RHS.AcquireAtCycle && - LHS.ReleaseAtCycle < RHS.ReleaseAtCycle); - }); + llvm::stable_sort( + ResourcesIt, + [](const MCWriteProcResEntry &LHS, + const MCWriteProcResEntry &RHS) -> bool { + return std::tie(LHS.AcquireAtCycle, LHS.ReleaseAtCycle) < + std::tie(RHS.AcquireAtCycle, RHS.ReleaseAtCycle); + }); for (const MCWriteProcResEntry &PI : ResourcesIt) { C = FirstCycle; const std::string ResName = @@ -1371,13 +1371,13 @@ LLVM_DUMP_METHOD void ScheduleDAGMI::dumpScheduleTraceBottomUp() const { SchedModel.getWriteProcResEnd(SC))); if (MISchedSortResourcesInTrace) - llvm::stable_sort(ResourcesIt, - [](const MCWriteProcResEntry &LHS, - const MCWriteProcResEntry &RHS) -> bool { - return LHS.AcquireAtCycle < RHS.AcquireAtCycle || - (LHS.AcquireAtCycle == RHS.AcquireAtCycle && - LHS.ReleaseAtCycle < RHS.ReleaseAtCycle); - }); + llvm::stable_sort( + ResourcesIt, + [](const MCWriteProcResEntry &LHS, + const MCWriteProcResEntry &RHS) -> bool { + return std::tie(LHS.AcquireAtCycle, LHS.ReleaseAtCycle) < + std::tie(RHS.AcquireAtCycle, RHS.ReleaseAtCycle); + }); for (const MCWriteProcResEntry &PI : ResourcesIt) { C = FirstCycle; const std::string ResName = |