diff options
author | Georgii Rymar <grimar@accesssoftek.com> | 2020-04-13 14:46:41 +0300 |
---|---|---|
committer | Georgii Rymar <grimar@accesssoftek.com> | 2020-04-14 14:11:02 +0300 |
commit | 1647ff6e2753026f8a1e21c60d37b83602520b64 (patch) | |
tree | 9bef856966e757bd7468c1e48f709ce38287e414 /llvm/lib/Analysis/LoopCacheAnalysis.cpp | |
parent | 58516718fc66de01f1221c7d30b06c297296a264 (diff) | |
download | llvm-1647ff6e2753026f8a1e21c60d37b83602520b64.zip llvm-1647ff6e2753026f8a1e21c60d37b83602520b64.tar.gz llvm-1647ff6e2753026f8a1e21c60d37b83602520b64.tar.bz2 |
[ADT/STLExtras.h] - Add llvm::is_sorted wrapper and update callers.
It can be used to avoid passing the begin and end of a range.
This makes the code shorter and it is consistent with another
wrappers we already have.
Differential revision: https://reviews.llvm.org/D78016
Diffstat (limited to 'llvm/lib/Analysis/LoopCacheAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopCacheAnalysis.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LoopCacheAnalysis.cpp b/llvm/lib/Analysis/LoopCacheAnalysis.cpp index c08a84e..6271bbf 100644 --- a/llvm/lib/Analysis/LoopCacheAnalysis.cpp +++ b/llvm/lib/Analysis/LoopCacheAnalysis.cpp @@ -64,10 +64,10 @@ static Loop *getInnerMostLoop(const LoopVectorTy &Loops) { return LastLoop; } - return (std::is_sorted(Loops.begin(), Loops.end(), - [](const Loop *L1, const Loop *L2) { - return L1->getLoopDepth() < L2->getLoopDepth(); - })) + return (llvm::is_sorted(Loops, + [](const Loop *L1, const Loop *L2) { + return L1->getLoopDepth() < L2->getLoopDepth(); + })) ? LastLoop : nullptr; } |