diff options
author | Fangrui Song <maskray@google.com> | 2019-04-23 14:51:27 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-04-23 14:51:27 +0000 |
commit | efd94c56badf696ed7193f4a83c7a59f7dfbfc6e (patch) | |
tree | 63f7a8a57c367cf6ba845a80eda9177b62c516be /llvm/lib/CodeGen/MachineSink.cpp | |
parent | 99cf58339fceadee43ba3fdbf962a083cd5af6c4 (diff) | |
download | llvm-efd94c56badf696ed7193f4a83c7a59f7dfbfc6e.zip llvm-efd94c56badf696ed7193f4a83c7a59f7dfbfc6e.tar.gz llvm-efd94c56badf696ed7193f4a83c7a59f7dfbfc6e.tar.bz2 |
Use llvm::stable_sort
While touching the code, simplify if feasible.
llvm-svn: 358996
Diffstat (limited to 'llvm/lib/CodeGen/MachineSink.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineSink.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp index fc61a34..41db2c8 100644 --- a/llvm/lib/CodeGen/MachineSink.cpp +++ b/llvm/lib/CodeGen/MachineSink.cpp @@ -584,9 +584,8 @@ MachineSinking::GetAllSortedSuccessors(MachineInstr &MI, MachineBasicBlock *MBB, AllSuccs.push_back(DTChild->getBlock()); // Sort Successors according to their loop depth or block frequency info. - std::stable_sort( - AllSuccs.begin(), AllSuccs.end(), - [this](const MachineBasicBlock *L, const MachineBasicBlock *R) { + llvm::stable_sort( + AllSuccs, [this](const MachineBasicBlock *L, const MachineBasicBlock *R) { uint64_t LHSFreq = MBFI ? MBFI->getBlockFreq(L).getFrequency() : 0; uint64_t RHSFreq = MBFI ? MBFI->getBlockFreq(R).getFrequency() : 0; bool HasBlockFreq = LHSFreq != 0 && RHSFreq != 0; |