diff options
author | Fangrui Song <maskray@google.com> | 2019-04-12 11:31:16 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-04-12 11:31:16 +0000 |
commit | fb79ff6ab5b79238cc41bd622c139916762631be (patch) | |
tree | 2d05300d262eb2569ca3c5ccc9bf4f72670eff30 | |
parent | eb312ddfdf81f53d727d1c456514bd45d8293f0e (diff) | |
download | bcm5719-llvm-fb79ff6ab5b79238cc41bd622c139916762631be.tar.gz bcm5719-llvm-fb79ff6ab5b79238cc41bd622c139916762631be.zip |
Use llvm::upper_bound. NFC
llvm-svn: 358277
-rw-r--r-- | llvm/lib/CodeGen/ExecutionDomainFix.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/CodeGen/LiveInterval.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/CodeGen/RegisterCoalescer.cpp | 3 |
4 files changed, 8 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/ExecutionDomainFix.cpp b/llvm/lib/CodeGen/ExecutionDomainFix.cpp index 8fb725a8296..fed9278141f 100644 --- a/llvm/lib/CodeGen/ExecutionDomainFix.cpp +++ b/llvm/lib/CodeGen/ExecutionDomainFix.cpp @@ -336,11 +336,10 @@ void ExecutionDomainFix::visitSoftInstr(MachineInstr *mi, unsigned mask) { } // Sorted insertion. // Enables giving priority to the latest domains during merging. - auto I = std::upper_bound( - Regs.begin(), Regs.end(), rx, [&](int LHS, const int RHS) { - return RDA->getReachingDef(mi, RC->getRegister(LHS)) < - RDA->getReachingDef(mi, RC->getRegister(RHS)); - }); + auto I = llvm::upper_bound(Regs, rx, [&](int LHS, const int RHS) { + return RDA->getReachingDef(mi, RC->getRegister(LHS)) < + RDA->getReachingDef(mi, RC->getRegister(RHS)); + }); Regs.insert(I, rx); } diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp index 32357ff657c..5dca699827b 100644 --- a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp @@ -506,9 +506,8 @@ LegalizerInfo::findAction(const SizeAndActionsVec &Vec, const uint32_t Size) { // Find the last element in Vec that has a bitsize equal to or smaller than // the requested bit size. // That is the element just before the first element that is bigger than Size. - auto VecIt = std::upper_bound( - Vec.begin(), Vec.end(), Size, - [](const uint32_t Size, const SizeAndAction lhs) -> bool { + auto VecIt = llvm::upper_bound( + Vec, Size, [](const uint32_t Size, const SizeAndAction lhs) -> bool { return Size < lhs.first; }); assert(VecIt != Vec.begin() && "Does Vec not start with size 1?"); diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp index 3dc030303a0..70b2a77fe80 100644 --- a/llvm/lib/CodeGen/LiveInterval.cpp +++ b/llvm/lib/CodeGen/LiveInterval.cpp @@ -296,9 +296,7 @@ private: iterator find(SlotIndex Pos) { return LR->find(Pos); } - iterator findInsertPos(Segment S) { - return std::upper_bound(LR->begin(), LR->end(), S.start); - } + iterator findInsertPos(Segment S) { return llvm::upper_bound(*LR, S.start); } }; //===----------------------------------------------------------------------===// diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp index 40b7e8ba788..ca53fe4f393 100644 --- a/llvm/lib/CodeGen/RegisterCoalescer.cpp +++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp @@ -693,8 +693,7 @@ bool RegisterCoalescer::hasOtherReachingDefs(LiveInterval &IntA, for (LiveRange::Segment &ASeg : IntA.segments) { if (ASeg.valno != AValNo) continue; - LiveInterval::iterator BI = - std::upper_bound(IntB.begin(), IntB.end(), ASeg.start); + LiveInterval::iterator BI = llvm::upper_bound(IntB, ASeg.start); if (BI != IntB.begin()) --BI; for (; BI != IntB.end() && ASeg.end >= BI->start; ++BI) { |