aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-04-23 14:51:27 +0000
committerFangrui Song <maskray@google.com>2019-04-23 14:51:27 +0000
commitefd94c56badf696ed7193f4a83c7a59f7dfbfc6e (patch)
tree63f7a8a57c367cf6ba845a80eda9177b62c516be /llvm/lib/Analysis/ScalarEvolution.cpp
parent99cf58339fceadee43ba3fdbf962a083cd5af6c4 (diff)
downloadllvm-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/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 1f69bc8..d7635a8 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -799,11 +799,10 @@ static void GroupByComplexity(SmallVectorImpl<const SCEV *> &Ops,
}
// Do the rough sort by complexity.
- std::stable_sort(Ops.begin(), Ops.end(),
- [&](const SCEV *LHS, const SCEV *RHS) {
- return CompareSCEVComplexity(EqCacheSCEV, EqCacheValue, LI,
- LHS, RHS, DT) < 0;
- });
+ llvm::stable_sort(Ops, [&](const SCEV *LHS, const SCEV *RHS) {
+ return CompareSCEVComplexity(EqCacheSCEV, EqCacheValue, LI, LHS, RHS, DT) <
+ 0;
+ });
// Now that we are sorted by complexity, group elements of the same
// complexity. Note that this is, at worst, N^2, but the vector is likely to