From efd94c56badf696ed7193f4a83c7a59f7dfbfc6e Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 23 Apr 2019 14:51:27 +0000 Subject: Use llvm::stable_sort While touching the code, simplify if feasible. llvm-svn: 358996 --- llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp') diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp index d748d967a5e..06d65b55890 100644 --- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp @@ -1722,10 +1722,9 @@ static bool rebuildLoopAfterUnswitch(Loop &L, ArrayRef ExitBlocks, // Sort the exits in ascending loop depth, we'll work backwards across these // to process them inside out. - std::stable_sort(ExitsInLoops.begin(), ExitsInLoops.end(), - [&](BasicBlock *LHS, BasicBlock *RHS) { - return LI.getLoopDepth(LHS) < LI.getLoopDepth(RHS); - }); + llvm::stable_sort(ExitsInLoops, [&](BasicBlock *LHS, BasicBlock *RHS) { + return LI.getLoopDepth(LHS) < LI.getLoopDepth(RHS); + }); // We'll build up a set for each exit loop. SmallPtrSet NewExitLoopBlocks; -- cgit v1.2.3