From 0cac726a00a2be06a959a89efe6587dba28e5822 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 27 Sep 2018 02:13:45 +0000 Subject: llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) Summary: The convenience wrapper in STLExtras is available since rL342102. Reviewers: dblaikie, javed.absar, JDevlieghere, andreadb Subscribers: MatzeB, sanjoy, arsenm, dschuff, mehdi_amini, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, javed.absar, gbedwell, jrtc27, mgrang, atanasyan, steven_wu, george.burgess.iv, dexonsmith, kristina, jsji, llvm-commits Differential Revision: https://reviews.llvm.org/D52573 llvm-svn: 343163 --- .../Target/AArch64/AArch64A57FPLoadBalancing.cpp | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp') diff --git a/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp b/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp index a95476b9118..452fbd3488b 100644 --- a/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp +++ b/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp @@ -377,11 +377,10 @@ bool AArch64A57FPLoadBalancing::runOnBasicBlock(MachineBasicBlock &MBB) { // Now we have a set of sets, order them by start address so // we can iterate over them sequentially. - llvm::sort(V.begin(), V.end(), - [](const std::vector &A, - const std::vector &B) { - return A.front()->startsBefore(B.front()); - }); + llvm::sort(V, + [](const std::vector &A, const std::vector &B) { + return A.front()->startsBefore(B.front()); + }); // As we only have two colors, we can track the global (BB-level) balance of // odds versus evens. We aim to keep this near zero to keep both execution @@ -453,16 +452,16 @@ bool AArch64A57FPLoadBalancing::colorChainSet(std::vector GV, // change them to! // Final tie-break with instruction order so pass output is stable (i.e. not // dependent on malloc'd pointer values). - llvm::sort(GV.begin(), GV.end(), [](const Chain *G1, const Chain *G2) { - if (G1->size() != G2->size()) - return G1->size() > G2->size(); - if (G1->requiresFixup() != G2->requiresFixup()) - return G1->requiresFixup() > G2->requiresFixup(); - // Make sure startsBefore() produces a stable final order. - assert((G1 == G2 || (G1->startsBefore(G2) ^ G2->startsBefore(G1))) && - "Starts before not total order!"); - return G1->startsBefore(G2); - }); + llvm::sort(GV, [](const Chain *G1, const Chain *G2) { + if (G1->size() != G2->size()) + return G1->size() > G2->size(); + if (G1->requiresFixup() != G2->requiresFixup()) + return G1->requiresFixup() > G2->requiresFixup(); + // Make sure startsBefore() produces a stable final order. + assert((G1 == G2 || (G1->startsBefore(G2) ^ G2->startsBefore(G1))) && + "Starts before not total order!"); + return G1->startsBefore(G2); + }); Color PreferredColor = Parity < 0 ? Color::Even : Color::Odd; while (Chain *G = getAndEraseNext(PreferredColor, GV)) { -- cgit v1.2.3