diff options
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMConstantIslandPass.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonGenInsert.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/Mips16ISelLowering.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/MipsConstantIslandPass.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86EvexToVex.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86FloatingPoint.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrFMA3Info.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrFoldTables.cpp | 6 |
10 files changed, 17 insertions, 33 deletions
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp index 20154bacbd3..60e5d7bf609 100644 --- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp +++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp @@ -875,9 +875,7 @@ void ARMConstantIslands::updateForInsertedWaterBlock(MachineBasicBlock *NewBB) { // Next, update WaterList. Specifically, we need to add NewMBB as having // available water after it. - water_iterator IP = - std::lower_bound(WaterList.begin(), WaterList.end(), NewBB, - CompareMBBNumbers); + water_iterator IP = llvm::lower_bound(WaterList, NewBB, CompareMBBNumbers); WaterList.insert(IP, NewBB); } @@ -928,9 +926,7 @@ MachineBasicBlock *ARMConstantIslands::splitBlockBeforeInstr(MachineInstr *MI) { // available water after it (but not if it's already there, which happens // when splitting before a conditional branch that is followed by an // unconditional branch - in that case we want to insert NewBB). - water_iterator IP = - std::lower_bound(WaterList.begin(), WaterList.end(), OrigBB, - CompareMBBNumbers); + water_iterator IP = llvm::lower_bound(WaterList, OrigBB, CompareMBBNumbers); MachineBasicBlock* WaterBB = *IP; if (WaterBB == OrigBB) WaterList.insert(std::next(IP), NewBB); diff --git a/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp b/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp index a27f7f157de..b32ba3eeea1 100644 --- a/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp +++ b/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp @@ -423,8 +423,7 @@ static const NEONLdStTableEntry *LookupNEONLdSt(unsigned Opcode) { } #endif - auto I = std::lower_bound(std::begin(NEONLdStTable), - std::end(NEONLdStTable), Opcode); + auto I = llvm::lower_bound(NEONLdStTable, Opcode); if (I != std::end(NEONLdStTable) && I->PseudoOpc == Opcode) return I; return nullptr; diff --git a/llvm/lib/Target/Hexagon/HexagonGenInsert.cpp b/llvm/lib/Target/Hexagon/HexagonGenInsert.cpp index 725cfe04df3..81025c1c532 100644 --- a/llvm/lib/Target/Hexagon/HexagonGenInsert.cpp +++ b/llvm/lib/Target/Hexagon/HexagonGenInsert.cpp @@ -436,7 +436,7 @@ namespace { } // end anonymous namespace void OrderedRegisterList::insert(unsigned VR) { - iterator L = std::lower_bound(Seq.begin(), Seq.end(), VR, Ord); + iterator L = llvm::lower_bound(Seq, VR, Ord); if (L == Seq.end()) Seq.push_back(VR); else @@ -449,7 +449,7 @@ void OrderedRegisterList::insert(unsigned VR) { } void OrderedRegisterList::remove(unsigned VR) { - iterator L = std::lower_bound(Seq.begin(), Seq.end(), VR, Ord); + iterator L = llvm::lower_bound(Seq, VR, Ord); if (L != Seq.end()) Seq.erase(L); } diff --git a/llvm/lib/Target/Mips/Mips16ISelLowering.cpp b/llvm/lib/Target/Mips/Mips16ISelLowering.cpp index 45162efb512..6d8e5aef2a3 100644 --- a/llvm/lib/Target/Mips/Mips16ISelLowering.cpp +++ b/llvm/lib/Target/Mips/Mips16ISelLowering.cpp @@ -459,8 +459,7 @@ getOpndList(SmallVectorImpl<SDValue> &Ops, } // one more look at list of intrinsics const Mips16IntrinsicHelperType *Helper = - std::lower_bound(std::begin(Mips16IntrinsicHelper), - std::end(Mips16IntrinsicHelper), IntrinsicFind); + llvm::lower_bound(Mips16IntrinsicHelper, IntrinsicFind); if (Helper != std::end(Mips16IntrinsicHelper) && *Helper == IntrinsicFind) { Mips16HelperFunction = Helper->Helper; diff --git a/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp b/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp index c10d9c38f50..eea28df7eda 100644 --- a/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp +++ b/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp @@ -841,9 +841,7 @@ void MipsConstantIslands::updateForInsertedWaterBlock // Next, update WaterList. Specifically, we need to add NewMBB as having // available water after it. - water_iterator IP = - std::lower_bound(WaterList.begin(), WaterList.end(), NewBB, - CompareMBBNumbers); + water_iterator IP = llvm::lower_bound(WaterList, NewBB, CompareMBBNumbers); WaterList.insert(IP, NewBB); } @@ -893,9 +891,7 @@ MipsConstantIslands::splitBlockBeforeInstr(MachineInstr &MI) { // available water after it (but not if it's already there, which happens // when splitting before a conditional branch that is followed by an // unconditional branch - in that case we want to insert NewBB). - water_iterator IP = - std::lower_bound(WaterList.begin(), WaterList.end(), OrigBB, - CompareMBBNumbers); + water_iterator IP = llvm::lower_bound(WaterList, OrigBB, CompareMBBNumbers); MachineBasicBlock* WaterBB = *IP; if (WaterBB == OrigBB) WaterList.insert(std::next(IP), NewBB); diff --git a/llvm/lib/Target/X86/X86EvexToVex.cpp b/llvm/lib/Target/X86/X86EvexToVex.cpp index 21ae1f1896b..58680f1815b 100644 --- a/llvm/lib/Target/X86/X86EvexToVex.cpp +++ b/llvm/lib/Target/X86/X86EvexToVex.cpp @@ -252,7 +252,7 @@ bool EvexToVexInstPass::CompressEvexToVexImpl(MachineInstr &MI) const { (Desc.TSFlags & X86II::VEX_L) ? makeArrayRef(X86EvexToVex256CompressTable) : makeArrayRef(X86EvexToVex128CompressTable); - auto I = std::lower_bound(Table.begin(), Table.end(), MI.getOpcode()); + auto I = llvm::lower_bound(Table, MI.getOpcode()); if (I == Table.end() || I->EvexOpcode != MI.getOpcode()) return false; diff --git a/llvm/lib/Target/X86/X86FloatingPoint.cpp b/llvm/lib/Target/X86/X86FloatingPoint.cpp index f82ad190fc8..074cf21d03f 100644 --- a/llvm/lib/Target/X86/X86FloatingPoint.cpp +++ b/llvm/lib/Target/X86/X86FloatingPoint.cpp @@ -596,7 +596,7 @@ namespace { } static int Lookup(ArrayRef<TableEntry> Table, unsigned Opcode) { - const TableEntry *I = std::lower_bound(Table.begin(), Table.end(), Opcode); + const TableEntry *I = llvm::lower_bound(Table, Opcode); if (I != Table.end() && I->from == Opcode) return I->to; return -1; diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index a4d06f068bb..301bd5724f1 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -13099,11 +13099,9 @@ static SDValue lowerV8I16GeneralSingleInputShuffle( copy_if(HiMask, std::back_inserter(HiInputs), [](int M) { return M >= 0; }); array_pod_sort(HiInputs.begin(), HiInputs.end()); HiInputs.erase(std::unique(HiInputs.begin(), HiInputs.end()), HiInputs.end()); - int NumLToL = - std::lower_bound(LoInputs.begin(), LoInputs.end(), 4) - LoInputs.begin(); + int NumLToL = llvm::lower_bound(LoInputs, 4) - LoInputs.begin(); int NumHToL = LoInputs.size() - NumLToL; - int NumLToH = - std::lower_bound(HiInputs.begin(), HiInputs.end(), 4) - HiInputs.begin(); + int NumLToH = llvm::lower_bound(HiInputs, 4) - HiInputs.begin(); int NumHToH = HiInputs.size() - NumLToH; MutableArrayRef<int> LToLInputs(LoInputs.data(), NumLToL); MutableArrayRef<int> LToHInputs(HiInputs.data(), NumLToH); diff --git a/llvm/lib/Target/X86/X86InstrFMA3Info.cpp b/llvm/lib/Target/X86/X86InstrFMA3Info.cpp index f917b06a52e..77dc75386fc 100644 --- a/llvm/lib/Target/X86/X86InstrFMA3Info.cpp +++ b/llvm/lib/Target/X86/X86InstrFMA3Info.cpp @@ -158,11 +158,9 @@ const X86InstrFMA3Group *llvm::getFMA3Group(unsigned Opcode, uint64_t TSFlags) { // FMA 231 instructions have an opcode of 0xB6-0xBF unsigned FormIndex = ((BaseOpcode - 0x90) >> 4) & 0x3; - auto I = std::lower_bound(Table.begin(), Table.end(), Opcode, - [FormIndex](const X86InstrFMA3Group &Group, - unsigned Opcode) { - return Group.Opcodes[FormIndex] < Opcode; - }); + auto I = llvm::bsearch(Table, [=](const X86InstrFMA3Group &Group) { + return Opcode <= Group.Opcodes[FormIndex]; + }); assert(I != Table.end() && I->Opcodes[FormIndex] == Opcode && "Couldn't find FMA3 opcode!"); return I; diff --git a/llvm/lib/Target/X86/X86InstrFoldTables.cpp b/llvm/lib/Target/X86/X86InstrFoldTables.cpp index 4b24dd1058e..b1eb6396bc5 100644 --- a/llvm/lib/Target/X86/X86InstrFoldTables.cpp +++ b/llvm/lib/Target/X86/X86InstrFoldTables.cpp @@ -5288,9 +5288,7 @@ lookupFoldTableImpl(ArrayRef<X86MemoryFoldTableEntry> Table, unsigned RegOp) { } #endif - const X86MemoryFoldTableEntry *Data = std::lower_bound(Table.begin(), - Table.end(), - RegOp); + const X86MemoryFoldTableEntry *Data = llvm::lower_bound(Table, RegOp); if (Data != Table.end() && Data->KeyOp == RegOp && !(Data->Flags & TB_NO_FORWARD)) return Data; @@ -5377,7 +5375,7 @@ static ManagedStatic<X86MemUnfoldTable> MemUnfoldTable; const X86MemoryFoldTableEntry * llvm::lookupUnfoldTable(unsigned MemOp) { auto &Table = MemUnfoldTable->Table; - auto I = std::lower_bound(Table.begin(), Table.end(), MemOp); + auto I = llvm::lower_bound(Table, MemOp); if (I != Table.end() && I->KeyOp == MemOp) return &*I; return nullptr; |

