[llvm] r278433 - Use the range variant of find instead of unpacking begin/end

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 21:52:15 PDT 2016


On Thu, Aug 11, 2016 at 9:39 PM, Mehdi Amini <mehdi.amini at apple.com> wrote:

> That’s a really nice cleanup!
>

Thanks!


>
> Did you use some clang-tidy rules (or another tool) or it was all manual?
>

Nothing quite so high-tech, just some sed rules:
git ls-files -z | xargs -0 sed -i 's/std::find(\(.*\)\.begin(),
\1\.end()/find(\1/'
git ls-files -z | xargs -0 sed -i 's/find(\(.*\)\, \(.*\)) ==
\1.end()/!is_contained(\1, \2)/'
git ls-files -z | xargs -0 sed -i 's/find(\(.*\)\, \(.*\)) !=
\1.end()/is_contained(\1, \2)/'


>
>> Mehdi
>
> > On Aug 11, 2016, at 3:21 PM, David Majnemer via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
> >
> > Author: majnemer
> > Date: Thu Aug 11 17:21:41 2016
> > New Revision: 278433
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=278433&view=rev
> > Log:
> > Use the range variant of find instead of unpacking begin/end
> >
> > If the result of the find is only used to compare against end(), just
> > use is_contained instead.
> >
> > No functionality change is intended.
> >
> > Modified:
> >    llvm/trunk/examples/Kaleidoscope/include/KaleidoscopeJIT.h
> >    llvm/trunk/include/llvm/ADT/PriorityQueue.h
> >    llvm/trunk/include/llvm/ADT/SetVector.h
> >    llvm/trunk/include/llvm/Analysis/LoopInfo.h
> >    llvm/trunk/include/llvm/Analysis/LoopInfoImpl.h
> >    llvm/trunk/include/llvm/CodeGen/LiveVariables.h
> >    llvm/trunk/include/llvm/CodeGen/MachineScheduler.h
> >    llvm/trunk/include/llvm/CodeGen/PBQP/Graph.h
> >    llvm/trunk/include/llvm/IR/InstrTypes.h
> >    llvm/trunk/include/llvm/MC/MCAssembler.h
> >    llvm/trunk/include/llvm/Support/GenericDomTree.h
> >    llvm/trunk/lib/Analysis/EHPersonalities.cpp
> >    llvm/trunk/lib/Analysis/GlobalsModRef.cpp
> >    llvm/trunk/lib/Analysis/LazyCallGraph.cpp
> >    llvm/trunk/lib/Analysis/PHITransAddr.cpp
> >    llvm/trunk/lib/CodeGen/AllocationOrder.cpp
> >    llvm/trunk/lib/CodeGen/AllocationOrder.h
> >    llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
> >    llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp
> >    llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp
> >    llvm/trunk/lib/CodeGen/LatencyPriorityQueue.cpp
> >    llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp
> >    llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
> >    llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp
> >    llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp
> >    llvm/trunk/lib/CodeGen/MachineLICM.cpp
> >    llvm/trunk/lib/CodeGen/MachineVerifier.cpp
> >    llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
> >    llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
> >    llvm/trunk/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
> >    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
> >    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
> >    llvm/trunk/lib/CodeGen/TailDuplicator.cpp
> >    llvm/trunk/lib/CodeGen/TargetInstrInfo.cpp
> >    llvm/trunk/lib/CodeGen/TargetRegisterInfo.cpp
> >    llvm/trunk/lib/IR/LegacyPassManager.cpp
> >    llvm/trunk/lib/IR/PassRegistry.cpp
> >    llvm/trunk/lib/Option/OptTable.cpp
> >    llvm/trunk/lib/Support/CommandLine.cpp
> >    llvm/trunk/lib/Support/YAMLParser.cpp
> >    llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
> >    llvm/trunk/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
> >    llvm/trunk/lib/Target/AMDGPU/R600OptimizeVectorRegisters.cpp
> >    llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
> >    llvm/trunk/lib/Target/AMDGPU/SIMachineScheduler.cpp
> >    llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
> >    llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
> >    llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp
> >    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
> >    llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
> >    llvm/trunk/lib/Target/Hexagon/HexagonBitSimplify.cpp
> >    llvm/trunk/lib/Target/Hexagon/HexagonMachineScheduler.h
> >    llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
> >    llvm/trunk/lib/Target/Mips/MipsConstantIslandPass.cpp
> >    llvm/trunk/lib/Target/NVPTX/NVPTXUtilities.cpp
> >    llvm/trunk/lib/Target/Sparc/LeonPasses.cpp   (contents, props
> changed)
> >    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
> >    llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
> >    llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp
> >    llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
> >    llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
> >    llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp
> >    llvm/trunk/lib/Transforms/Utils/Evaluator.cpp
> >    llvm/trunk/lib/Transforms/Utils/LCSSA.cpp
> >    llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
> >    llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
> >    llvm/trunk/tools/bugpoint/CrashDebugger.cpp
> >    llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp
> >    llvm/trunk/tools/llvm-ar/llvm-ar.cpp
> >    llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
> >    llvm/trunk/unittests/Support/Path.cpp
> >    llvm/trunk/unittests/Support/ThreadPool.cpp
> >    llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
> >    llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h
> >    llvm/trunk/utils/TableGen/CodeGenRegisters.cpp
> >    llvm/trunk/utils/TableGen/CodeGenSchedule.cpp
> >    llvm/trunk/utils/TableGen/CodeGenTarget.h
> >    llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
> >
> > Modified: llvm/trunk/examples/Kaleidoscope/include/KaleidoscopeJIT.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/
> Kaleidoscope/include/KaleidoscopeJIT.h?rev=278433&
> r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/examples/Kaleidoscope/include/KaleidoscopeJIT.h
> (original)
> > +++ llvm/trunk/examples/Kaleidoscope/include/KaleidoscopeJIT.h Thu Aug
> 11 17:21:41 2016
> > @@ -72,8 +72,7 @@ public:
> >   }
> >
> >   void removeModule(ModuleHandleT H) {
> > -    ModuleHandles.erase(
> > -        std::find(ModuleHandles.begin(), ModuleHandles.end(), H));
> > +    ModuleHandles.erase(find(ModuleHandles, H));
> >     CompileLayer.removeModuleSet(H);
> >   }
> >
> >
> > Modified: llvm/trunk/include/llvm/ADT/PriorityQueue.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/ADT/PriorityQueue.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/include/llvm/ADT/PriorityQueue.h (original)
> > +++ llvm/trunk/include/llvm/ADT/PriorityQueue.h Thu Aug 11 17:21:41 2016
> > @@ -46,8 +46,7 @@ public:
> >   ///
> >   void erase_one(const T &t) {
> >     // Linear-search to find the element.
> > -    typename Sequence::size_type i =
> > -      std::find(this->c.begin(), this->c.end(), t) - this->c.begin();
> > +    typename Sequence::size_type i = find(this->c, t) - this->c.begin();
> >
> >     // Logarithmic-time heap bubble-up.
> >     while (i != 0) {
> >
> > Modified: llvm/trunk/include/llvm/ADT/SetVector.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/ADT/SetVector.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/include/llvm/ADT/SetVector.h (original)
> > +++ llvm/trunk/include/llvm/ADT/SetVector.h Thu Aug 11 17:21:41 2016
> > @@ -21,6 +21,7 @@
> > #define LLVM_ADT_SETVECTOR_H
> >
> > #include "llvm/ADT/DenseSet.h"
> > +#include "llvm/ADT/STLExtras.h"
> > #include "llvm/ADT/SmallSet.h"
> > #include <algorithm>
> > #include <cassert>
> > @@ -143,8 +144,7 @@ public:
> >   /// \brief Remove an item from the set vector.
> >   bool remove(const value_type& X) {
> >     if (set_.erase(X)) {
> > -      typename vector_type::iterator I =
> > -        std::find(vector_.begin(), vector_.end(), X);
> > +      typename vector_type::iterator I = find(vector_, X);
> >       assert(I != vector_.end() && "Corrupted SetVector instances!");
> >       vector_.erase(I);
> >       return true;
> >
> > Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/Analysis/LoopInfo.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
> > +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Thu Aug 11 17:21:41 2016
> > @@ -329,7 +329,7 @@ public:
> >   /// Blocks as appropriate. This does not update the mapping in the
> LoopInfo
> >   /// class.
> >   void removeBlockFromLoop(BlockT *BB) {
> > -    auto I = std::find(Blocks.begin(), Blocks.end(), BB);
> > +    auto I = find(Blocks, BB);
> >     assert(I != Blocks.end() && "N is not in this list!");
> >     Blocks.erase(I);
> >
> > @@ -594,7 +594,7 @@ public:
> >   /// loop.
> >   void changeTopLevelLoop(LoopT *OldLoop,
> >                           LoopT *NewLoop) {
> > -    auto I = std::find(TopLevelLoops.begin(), TopLevelLoops.end(),
> OldLoop);
> > +    auto I = find(TopLevelLoops, OldLoop);
> >     assert(I != TopLevelLoops.end() && "Old loop not at top level!");
> >     *I = NewLoop;
> >     assert(!NewLoop->ParentLoop && !OldLoop->ParentLoop &&
> >
> > Modified: llvm/trunk/include/llvm/Analysis/LoopInfoImpl.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/Analysis/LoopInfoImpl.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/include/llvm/Analysis/LoopInfoImpl.h (original)
> > +++ llvm/trunk/include/llvm/Analysis/LoopInfoImpl.h Thu Aug 11 17:21:41
> 2016
> > @@ -211,8 +211,7 @@ void LoopBase<BlockT, LoopT>::
> > replaceChildLoopWith(LoopT *OldChild, LoopT *NewChild) {
> >   assert(OldChild->ParentLoop == this && "This loop is already broken!");
> >   assert(!NewChild->ParentLoop && "NewChild already has a parent!");
> > -  typename std::vector<LoopT *>::iterator I =
> > -    std::find(SubLoops.begin(), SubLoops.end(), OldChild);
> > +  typename std::vector<LoopT *>::iterator I = find(SubLoops, OldChild);
> >   assert(I != SubLoops.end() && "OldChild not in loop!");
> >   *I = NewChild;
> >   OldChild->ParentLoop = nullptr;
> >
> > Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/CodeGen/LiveVariables.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original)
> > +++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Thu Aug 11 17:21:41
> 2016
> > @@ -92,8 +92,7 @@ public:
> >     /// machine instruction. Returns true if there was a kill
> >     /// corresponding to this instruction, false otherwise.
> >     bool removeKill(MachineInstr &MI) {
> > -      std::vector<MachineInstr *>::iterator I =
> > -          std::find(Kills.begin(), Kills.end(), &MI);
> > +      std::vector<MachineInstr *>::iterator I = find(Kills, &MI);
> >       if (I == Kills.end())
> >         return false;
> >       Kills.erase(I);
> >
> > Modified: llvm/trunk/include/llvm/CodeGen/MachineScheduler.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/CodeGen/MachineScheduler.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/include/llvm/CodeGen/MachineScheduler.h (original)
> > +++ llvm/trunk/include/llvm/CodeGen/MachineScheduler.h Thu Aug 11
> 17:21:41 2016
> > @@ -518,9 +518,7 @@ public:
> >
> >   ArrayRef<SUnit*> elements() { return Queue; }
> >
> > -  iterator find(SUnit *SU) {
> > -    return std::find(Queue.begin(), Queue.end(), SU);
> > -  }
> > +  iterator find(SUnit *SU) { return llvm::find(Queue, SU); }
> >
> >   void push(SUnit *SU) {
> >     Queue.push_back(SU);
> >
> > Modified: llvm/trunk/include/llvm/CodeGen/PBQP/Graph.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/CodeGen/PBQP/Graph.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/include/llvm/CodeGen/PBQP/Graph.h (original)
> > +++ llvm/trunk/include/llvm/CodeGen/PBQP/Graph.h Thu Aug 11 17:21:41
> 2016
> > @@ -262,9 +262,7 @@ namespace PBQP {
> >
> >     private:
> >       NodeId findNextInUse(NodeId NId) const {
> > -        while (NId < EndNId &&
> > -               std::find(FreeNodeIds.begin(), FreeNodeIds.end(), NId) !=
> > -               FreeNodeIds.end()) {
> > +        while (NId < EndNId && is_contained(FreeNodeIds, NId)) {
> >           ++NId;
> >         }
> >         return NId;
> > @@ -288,9 +286,7 @@ namespace PBQP {
> >
> >     private:
> >       EdgeId findNextInUse(EdgeId EId) const {
> > -        while (EId < EndEId &&
> > -               std::find(FreeEdgeIds.begin(), FreeEdgeIds.end(), EId) !=
> > -               FreeEdgeIds.end()) {
> > +        while (EId < EndEId && is_contained(FreeEdgeIds, EId)) {
> >           ++EId;
> >         }
> >         return EId;
> >
> > Modified: llvm/trunk/include/llvm/IR/InstrTypes.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/IR/InstrTypes.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/include/llvm/IR/InstrTypes.h (original)
> > +++ llvm/trunk/include/llvm/IR/InstrTypes.h Thu Aug 11 17:21:41 2016
> > @@ -1478,7 +1478,7 @@ public:
> >   bool hasOperandBundlesOtherThan(ArrayRef<uint32_t> IDs) const {
> >     for (unsigned i = 0, e = getNumOperandBundles(); i != e; ++i) {
> >       uint32_t ID = getOperandBundleAt(i).getTagID();
> > -      if (std::find(IDs.begin(), IDs.end(), ID) == IDs.end())
> > +      if (!is_contained(IDs, ID))
> >         return true;
> >     }
> >     return false;
> >
> > Modified: llvm/trunk/include/llvm/MC/MCAssembler.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/MC/MCAssembler.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/include/llvm/MC/MCAssembler.h (original)
> > +++ llvm/trunk/include/llvm/MC/MCAssembler.h Thu Aug 11 17:21:41 2016
> > @@ -10,6 +10,7 @@
> > #ifndef LLVM_MC_MCASSEMBLER_H
> > #define LLVM_MC_MCASSEMBLER_H
> >
> > +#include "llvm/ADT/STLExtras.h"
> > #include "llvm/ADT/SmallPtrSet.h"
> > #include "llvm/ADT/ilist.h"
> > #include "llvm/ADT/ilist_node.h"
> > @@ -402,8 +403,7 @@ public:
> >   ArrayRef<std::string> getFileNames() { return FileNames; }
> >
> >   void addFileName(StringRef FileName) {
> > -    if (std::find(FileNames.begin(), FileNames.end(), FileName) ==
> > -        FileNames.end())
> > +    if (!is_contained(FileNames, FileName))
> >       FileNames.push_back(FileName);
> >   }
> >
> >
> > Modified: llvm/trunk/include/llvm/Support/GenericDomTree.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/Support/GenericDomTree.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/include/llvm/Support/GenericDomTree.h (original)
> > +++ llvm/trunk/include/llvm/Support/GenericDomTree.h Thu Aug 11
> 17:21:41 2016
> > @@ -126,7 +126,7 @@ public:
> >     assert(IDom && "No immediate dominator?");
> >     if (IDom != NewIDom) {
> >       typename std::vector<DomTreeNodeBase<NodeT> *>::iterator I =
> > -          std::find(IDom->Children.begin(), IDom->Children.end(),
> this);
> > +          find(IDom->Children, this);
> >       assert(I != IDom->Children.end() &&
> >              "Not in immediate dominator children set!");
> >       // I am no longer your child...
> > @@ -588,7 +588,7 @@ public:
> >     DomTreeNodeBase<NodeT> *IDom = Node->getIDom();
> >     if (IDom) {
> >       typename std::vector<DomTreeNodeBase<NodeT> *>::iterator I =
> > -          std::find(IDom->Children.begin(), IDom->Children.end(),
> Node);
> > +          find(IDom->Children, Node);
> >       assert(I != IDom->Children.end() &&
> >              "Not in immediate dominator children set!");
> >       // I am no longer your child...
> >
> > Modified: llvm/trunk/lib/Analysis/EHPersonalities.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Analysis/EHPersonalities.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Analysis/EHPersonalities.cpp (original)
> > +++ llvm/trunk/lib/Analysis/EHPersonalities.cpp Thu Aug 11 17:21:41 2016
> > @@ -82,7 +82,7 @@ DenseMap<BasicBlock *, ColorVector> llvm
> >     }
> >     // Note that this is a member of the given color.
> >     ColorVector &Colors = BlockColors[Visiting];
> > -    if (std::find(Colors.begin(), Colors.end(), Color) == Colors.end())
> > +    if (!is_contained(Colors, Color))
> >       Colors.push_back(Color);
> >     else
> >       continue;
> >
> > Modified: llvm/trunk/lib/Analysis/GlobalsModRef.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Analysis/GlobalsModRef.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Analysis/GlobalsModRef.cpp (original)
> > +++ llvm/trunk/lib/Analysis/GlobalsModRef.cpp Thu Aug 11 17:21:41 2016
> > @@ -521,7 +521,7 @@ void GlobalsAAResult::AnalyzeCallGraph(C
> >             // Can't say anything about it.  However, if it is inside
> our SCC,
> >             // then nothing needs to be done.
> >             CallGraphNode *CalleeNode = CG[Callee];
> > -            if (std::find(SCC.begin(), SCC.end(), CalleeNode) ==
> SCC.end())
> > +            if (!is_contained(SCC, CalleeNode))
> >               KnowNothing = true;
> >           }
> >         } else {
> >
> > Modified: llvm/trunk/lib/Analysis/LazyCallGraph.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Analysis/LazyCallGraph.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Analysis/LazyCallGraph.cpp (original)
> > +++ llvm/trunk/lib/Analysis/LazyCallGraph.cpp Thu Aug 11 17:21:41 2016
> > @@ -907,8 +907,7 @@ void LazyCallGraph::RefSCC::removeOutgoi
> >   RefSCC &TargetRC = *G->lookupRefSCC(TargetN);
> >   assert(&TargetRC != this && "The target must not be a member of this
> RefSCC");
> >
> > -  assert(std::find(G->LeafRefSCCs.begin(), G->LeafRefSCCs.end(), this)
> ==
> > -             G->LeafRefSCCs.end() &&
> > +  assert(!is_contained(G->LeafRefSCCs, this) &&
> >          "Cannot have a leaf RefSCC source.");
> >
> >   // First remove it from the node.
> >
> > Modified: llvm/trunk/lib/Analysis/PHITransAddr.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Analysis/PHITransAddr.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Analysis/PHITransAddr.cpp (original)
> > +++ llvm/trunk/lib/Analysis/PHITransAddr.cpp Thu Aug 11 17:21:41 2016
> > @@ -62,8 +62,7 @@ static bool VerifySubExpr(Value *Expr,
> >
> >   // If it's an instruction, it is either in Tmp or its operands
> recursively
> >   // are.
> > -  SmallVectorImpl<Instruction*>::iterator Entry =
> > -    std::find(InstInputs.begin(), InstInputs.end(), I);
> > +  SmallVectorImpl<Instruction *>::iterator Entry = find(InstInputs, I);
> >   if (Entry != InstInputs.end()) {
> >     InstInputs.erase(Entry);
> >     return true;
> > @@ -126,8 +125,7 @@ static void RemoveInstInputs(Value *V,
> >   if (!I) return;
> >
> >   // If the instruction is in the InstInputs list, remove it.
> > -  SmallVectorImpl<Instruction*>::iterator Entry =
> > -    std::find(InstInputs.begin(), InstInputs.end(), I);
> > +  SmallVectorImpl<Instruction *>::iterator Entry = find(InstInputs, I);
> >   if (Entry != InstInputs.end()) {
> >     InstInputs.erase(Entry);
> >     return;
> > @@ -150,8 +148,7 @@ Value *PHITransAddr::PHITranslateSubExpr
> >   if (!Inst) return V;
> >
> >   // Determine whether 'Inst' is an input to our PHI translatable
> expression.
> > -  bool isInput =
> > -      std::find(InstInputs.begin(), InstInputs.end(), Inst) !=
> InstInputs.end();
> > +  bool isInput = is_contained(InstInputs, Inst);
> >
> >   // Handle inputs instructions if needed.
> >   if (isInput) {
> > @@ -165,7 +162,7 @@ Value *PHITransAddr::PHITranslateSubExpr
> >     // translated, we need to incorporate the value into the expression
> or fail.
> >
> >     // In either case, the instruction itself isn't an input any longer.
> > -    InstInputs.erase(std::find(InstInputs.begin(), InstInputs.end(),
> Inst));
> > +    InstInputs.erase(find(InstInputs, Inst));
> >
> >     // If this is a PHI, go ahead and translate it.
> >     if (PHINode *PN = dyn_cast<PHINode>(Inst))
> > @@ -272,8 +269,7 @@ Value *PHITransAddr::PHITranslateSubExpr
> >           isNSW = isNUW = false;
> >
> >           // If the old 'LHS' was an input, add the new 'LHS' as an
> input.
> > -          if (std::find(InstInputs.begin(), InstInputs.end(), BOp) !=
> > -              InstInputs.end()) {
> > +          if (is_contained(InstInputs, BOp)) {
> >             RemoveInstInputs(BOp, InstInputs);
> >             AddAsInput(LHS);
> >           }
> >
> > Modified: llvm/trunk/lib/CodeGen/AllocationOrder.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/AllocationOrder.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/AllocationOrder.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/AllocationOrder.cpp Thu Aug 11 17:21:41 2016
> > @@ -48,7 +48,7 @@ AllocationOrder::AllocationOrder(unsigne
> >   });
> > #ifndef NDEBUG
> >   for (unsigned I = 0, E = Hints.size(); I != E; ++I)
> > -    assert(std::find(Order.begin(), Order.end(), Hints[I]) !=
> Order.end() &&
> > +    assert(is_contained(Order, Hints[I]) &&
> >            "Target hint is outside allocation order.");
> > #endif
> > }
> >
> > Modified: llvm/trunk/lib/CodeGen/AllocationOrder.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/AllocationOrder.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/AllocationOrder.h (original)
> > +++ llvm/trunk/lib/CodeGen/AllocationOrder.h Thu Aug 11 17:21:41 2016
> > @@ -18,6 +18,7 @@
> > #define LLVM_LIB_CODEGEN_ALLOCATIONORDER_H
> >
> > #include "llvm/ADT/ArrayRef.h"
> > +#include "llvm/ADT/STLExtras.h"
> > #include "llvm/MC/MCRegisterInfo.h"
> >
> > namespace llvm {
> > @@ -79,9 +80,7 @@ public:
> >   bool isHint() const { return Pos <= 0; }
> >
> >   /// Return true if PhysReg is a preferred register.
> > -  bool isHint(unsigned PhysReg) const {
> > -    return std::find(Hints.begin(), Hints.end(), PhysReg) !=
> Hints.end();
> > -  }
> > +  bool isHint(unsigned PhysReg) const { return is_contained(Hints,
> PhysReg); }
> > };
> >
> > } // end namespace llvm
> >
> > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/
> DbgValueHistoryCalculator.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp?rev=278433&r1=278432&r2=
> 278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
> (original)
> > +++ llvm/trunk/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp Thu
> Aug 11 17:21:41 2016
> > @@ -83,7 +83,7 @@ static void dropRegDescribedVar(RegDescr
> >   const auto &I = RegVars.find(RegNo);
> >   assert(RegNo != 0U && I != RegVars.end());
> >   auto &VarSet = I->second;
> > -  const auto &VarPos = std::find(VarSet.begin(), VarSet.end(), Var);
> > +  const auto &VarPos = find(VarSet, Var);
> >   assert(VarPos != VarSet.end());
> >   VarSet.erase(VarPos);
> >   // Don't keep empty sets in a map to keep it as small as possible.
> > @@ -96,7 +96,7 @@ static void addRegDescribedVar(RegDescri
> >                                InlinedVariable Var) {
> >   assert(RegNo != 0U);
> >   auto &VarSet = RegVars[RegNo];
> > -  assert(std::find(VarSet.begin(), VarSet.end(), Var) == VarSet.end());
> > +  assert(!is_contained(VarSet, Var));
> >   VarSet.push_back(Var);
> > }
> >
> >
> > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/AsmPrinter/OcamlGCPrinter.cpp?rev=278433&
> r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -50,7 +50,7 @@ static void EmitCamlGlobal(const Module
> >   std::string SymName;
> >   SymName += "caml";
> >   size_t Letter = SymName.size();
> > -  SymName.append(MId.begin(), std::find(MId.begin(), MId.end(), '.'));
> > +  SymName.append(MId.begin(), find(MId, '.'));
> >   SymName += "__";
> >   SymName += Id;
> >
> >
> > Modified: llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/CodeGenPrepare.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp Thu Aug 11 17:21:41 2016
> > @@ -3665,8 +3665,7 @@ isProfitableToFoldIntoAddressingMode(Ins
> >     TPT.rollback(LastKnownGood);
> >
> >     // If the match didn't cover I, then it won't be shared by it.
> > -    if (std::find(MatchedAddrModeInsts.begin(),
> MatchedAddrModeInsts.end(),
> > -                  I) == MatchedAddrModeInsts.end())
> > +    if (!is_contained(MatchedAddrModeInsts, I))
> >       return false;
> >
> >     MatchedAddrModeInsts.clear();
> >
> > Modified: llvm/trunk/lib/CodeGen/LatencyPriorityQueue.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/LatencyPriorityQueue.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/LatencyPriorityQueue.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/LatencyPriorityQueue.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -133,7 +133,7 @@ SUnit *LatencyPriorityQueue::pop() {
> >
> > void LatencyPriorityQueue::remove(SUnit *SU) {
> >   assert(!Queue.empty() && "Queue is empty!");
> > -  std::vector<SUnit *>::iterator I = std::find(Queue.begin(),
> Queue.end(), SU);
> > +  std::vector<SUnit *>::iterator I = find(Queue, SU);
> >   if (I != std::prev(Queue.end()))
> >     std::swap(*I, Queue.back());
> >   Queue.pop_back();
> >
> > Modified: llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/LiveIntervalUnion.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -14,6 +14,7 @@
> > //===-------------------------------------------------------
> ---------------===//
> >
> > #include "llvm/CodeGen/LiveIntervalUnion.h"
> > +#include "llvm/ADT/STLExtras.h"
> > #include "llvm/ADT/SparseBitVector.h"
> > #include "llvm/Support/Debug.h"
> > #include "llvm/Support/raw_ostream.h"
> > @@ -102,9 +103,7 @@ void LiveIntervalUnion::verify(LiveVirtR
> > // Scan the vector of interfering virtual registers in this union.
> Assume it's
> > // quite small.
> > bool LiveIntervalUnion::Query::isSeenInterference(LiveInterval
> *VirtReg) const {
> > -  SmallVectorImpl<LiveInterval*>::const_iterator I =
> > -    std::find(InterferingVRegs.begin(), InterferingVRegs.end(),
> VirtReg);
> > -  return I != InterferingVRegs.end();
> > +  return is_contained(InterferingVRegs, VirtReg);
> > }
> >
> > // Collect virtual registers in this union that interfere with this
> >
> > Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/MachineBasicBlock.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -545,7 +545,7 @@ void MachineBasicBlock::addSuccessorWith
> >
> > void MachineBasicBlock::removeSuccessor(MachineBasicBlock *Succ,
> >                                         bool NormalizeSuccProbs) {
> > -  succ_iterator I = std::find(Successors.begin(), Successors.end(),
> Succ);
> > +  succ_iterator I = find(Successors, Succ);
> >   removeSuccessor(I, NormalizeSuccProbs);
> > }
> >
> > @@ -611,7 +611,7 @@ void MachineBasicBlock::addPredecessor(M
> > }
> >
> > void MachineBasicBlock::removePredecessor(MachineBasicBlock *Pred) {
> > -  pred_iterator I = std::find(Predecessors.begin(),
> Predecessors.end(), Pred);
> > +  pred_iterator I = find(Predecessors, Pred);
> >   assert(I != Predecessors.end() && "Pred is not a predecessor of this
> block!");
> >   Predecessors.erase(I);
> > }
> > @@ -775,7 +775,7 @@ MachineBasicBlock *MachineBasicBlock::Sp
> >           continue;
> >
> >         unsigned Reg = OI->getReg();
> > -        if (std::find(UsedRegs.begin(), UsedRegs.end(), Reg) ==
> UsedRegs.end())
> > +        if (!is_contained(UsedRegs, Reg))
> >           UsedRegs.push_back(Reg);
> >       }
> >     }
> > @@ -802,9 +802,8 @@ MachineBasicBlock *MachineBasicBlock::Sp
> >
> >     for (SmallVectorImpl<MachineInstr*>::iterator I =
> Terminators.begin(),
> >         E = Terminators.end(); I != E; ++I) {
> > -      if (std::find(NewTerminators.begin(), NewTerminators.end(), *I)
> ==
> > -          NewTerminators.end())
> > -       Indexes->removeMachineInstrFromMaps(**I);
> > +      if (!is_contained(NewTerminators, *I))
> > +        Indexes->removeMachineInstrFromMaps(**I);
> >     }
> >   }
> >
> >
> > Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/MachineBlockPlacement.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -1166,8 +1166,7 @@ void MachineBlockPlacement::rotateLoop(B
> >     }
> >   }
> >
> > -  BlockChain::iterator ExitIt =
> > -      std::find(LoopChain.begin(), LoopChain.end(), ExitingBB);
> > +  BlockChain::iterator ExitIt = find(LoopChain, ExitingBB);
> >   if (ExitIt == LoopChain.end())
> >     return;
> >
> > @@ -1190,7 +1189,7 @@ void MachineBlockPlacement::rotateLoop(B
> > void MachineBlockPlacement::rotateLoopWithProfile(
> >     BlockChain &LoopChain, MachineLoop &L, const BlockFilterSet
> &LoopBlockSet) {
> >   auto HeaderBB = L.getHeader();
> > -  auto HeaderIter = std::find(LoopChain.begin(), LoopChain.end(),
> HeaderBB);
> > +  auto HeaderIter = find(LoopChain, HeaderBB);
> >   auto RotationPos = LoopChain.end();
> >
> >   BlockFrequency SmallestRotationCost = BlockFrequency::
> getMaxFrequency();
> >
> > Modified: llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/
> MachineCopyPropagation.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/MachineCopyPropagation.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -245,7 +245,7 @@ void MachineCopyPropagation::CopyPropaga
> >       // Remember source that's copied to Def. Once it's clobbered, then
> >       // it's no longer available for copy propagation.
> >       RegList &DestList = SrcMap[Src];
> > -      if (std::find(DestList.begin(), DestList.end(), Def) ==
> DestList.end())
> > +      if (!is_contained(DestList, Def))
> >         DestList.push_back(Def);
> >
> >       continue;
> >
> > Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/MachineLICM.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Thu Aug 11 17:21:41 2016
> > @@ -92,8 +92,7 @@ namespace {
> >     SmallVector<MachineBasicBlock*, 8> ExitBlocks;
> >
> >     bool isExitBlock(const MachineBasicBlock *MBB) const {
> > -      return std::find(ExitBlocks.begin(), ExitBlocks.end(), MBB) !=
> > -        ExitBlocks.end();
> > +      return is_contained(ExitBlocks, MBB);
> >     }
> >
> >     // Track 'estimated' register pressure.
> >
> > Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/MachineVerifier.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Thu Aug 11 17:21:41 2016
> > @@ -1238,7 +1238,7 @@ void MachineVerifier::checkLiveness(cons
> >     if (LiveVars && TargetRegisterInfo::isVirtualRegister(Reg) &&
> >         MO->isKill()) {
> >       LiveVariables::VarInfo &VI = LiveVars->getVarInfo(Reg);
> > -      if (std::find(VI.Kills.begin(), VI.Kills.end(), MI) ==
> VI.Kills.end())
> > +      if (!is_contained(VI.Kills, MI))
> >         report("Kill missing from LiveVariables", MO, MONum);
> >     }
> >
> >
> > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/SelectionDAG/DAGCombiner.cpp?rev=278433&r1=
> 278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -1571,8 +1571,7 @@ SDValue DAGCombiner::visitTokenFactor(SD
> >         break;
> >
> >       case ISD::TokenFactor:
> > -        if (Op.hasOneUse() &&
> > -            std::find(TFs.begin(), TFs.end(), Op.getNode()) ==
> TFs.end()) {
> > +        if (Op.hasOneUse() && !is_contained(TFs, Op.getNode())) {
> >           // Queue up for processing.
> >           TFs.push_back(Op.getNode());
> >           // Clean up in case the token factor is removed.
> >
> > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/SelectionDAG/FunctionLoweringInfo.cpp?rev=
> 278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
> (original)
> > +++ llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp Thu
> Aug 11 17:21:41 2016
> > @@ -599,8 +599,7 @@ void llvm::AddLandingPadInfo(const Landi
> > unsigned FunctionLoweringInfo::findSwiftErrorVReg(const
> MachineBasicBlock *MBB,
> >                                                   const Value* Val)
> const {
> >   // Find the index in SwiftErrorVals.
> > -  SwiftErrorValues::const_iterator I =
> > -      std::find(SwiftErrorVals.begin(), SwiftErrorVals.end(), Val);
> > +  SwiftErrorValues::const_iterator I = find(SwiftErrorVals, Val);
> >   assert(I != SwiftErrorVals.end() && "Can't find value in
> SwiftErrorVals");
> >   return SwiftErrorMap.lookup(MBB)[I - SwiftErrorVals.begin()];
> > }
> > @@ -608,8 +607,7 @@ unsigned FunctionLoweringInfo::findSwift
> > void FunctionLoweringInfo::setSwiftErrorVReg(const MachineBasicBlock
> *MBB,
> >                                              const Value* Val, unsigned
> VReg) {
> >   // Find the index in SwiftErrorVals.
> > -  SwiftErrorValues::iterator I =
> > -      std::find(SwiftErrorVals.begin(), SwiftErrorVals.end(), Val);
> > +  SwiftErrorValues::iterator I = find(SwiftErrorVals, Val);
> >   assert(I != SwiftErrorVals.end() && "Can't find value in
> SwiftErrorVals");
> >   SwiftErrorMap[MBB][I - SwiftErrorVals.begin()] = VReg;
> > }
> >
> > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/SelectionDAG/ResourcePriorityQueue.cpp?rev=
> 278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
> (original)
> > +++ llvm/trunk/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp Thu
> Aug 11 17:21:41 2016
> > @@ -631,7 +631,7 @@ SUnit *ResourcePriorityQueue::pop() {
> >
> > void ResourcePriorityQueue::remove(SUnit *SU) {
> >   assert(!Queue.empty() && "Queue is empty!");
> > -  std::vector<SUnit *>::iterator I = std::find(Queue.begin(),
> Queue.end(), SU);
> > +  std::vector<SUnit *>::iterator I = find(Queue, SU);
> >   if (I != std::prev(Queue.end()))
> >     std::swap(*I, Queue.back());
> >
> >
> > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=278433&r1=278432&r2=278433&
> view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Thu Aug
> 11 17:21:41 2016
> > @@ -1339,7 +1339,7 @@ void ScheduleDAGRRList::releaseInterfere
> >     LRegsMapT::iterator LRegsPos = LRegsMap.find(SU);
> >     if (Reg) {
> >       SmallVectorImpl<unsigned> &LRegs = LRegsPos->second;
> > -      if (std::find(LRegs.begin(), LRegs.end(), Reg) == LRegs.end())
> > +      if (!is_contained(LRegs, Reg))
> >         continue;
> >     }
> >     SU->isPending = false;
> > @@ -1704,8 +1704,7 @@ public:
> >   void remove(SUnit *SU) override {
> >     assert(!Queue.empty() && "Queue is empty!");
> >     assert(SU->NodeQueueId != 0 && "Not in queue!");
> > -    std::vector<SUnit *>::iterator I = std::find(Queue.begin(),
> Queue.end(),
> > -                                                 SU);
> > +    std::vector<SUnit *>::iterator I = find(Queue, SU);
> >     if (I != std::prev(Queue.end()))
> >       std::swap(*I, Queue.back());
> >     Queue.pop_back();
> >
> > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=278433&r1=278432&r2=278433&
> view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -3388,7 +3388,7 @@ void SelectionDAGISel::SelectCodeCommon(
> >         SelectionDAG::DAGNodeDeletedListener NDL(*CurDAG, [&](SDNode *N,
> >                                                               SDNode *E)
> {
> >           auto &Chain = ChainNodesMatched;
> > -          assert((!E || llvm::find(Chain, N) == Chain.end()) &&
> > +          assert((!E || !is_contained(Chain, N)) &&
> >                  "Chain node replaced during MorphNode");
> >           Chain.erase(std::remove(Chain.begin(), Chain.end(), N),
> Chain.end());
> >         });
> >
> > Modified: llvm/trunk/lib/CodeGen/TailDuplicator.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/TailDuplicator.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/TailDuplicator.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/TailDuplicator.cpp Thu Aug 11 17:21:41 2016
> > @@ -900,7 +900,7 @@ bool TailDuplicator::tailDuplicate(Machi
> >                                                         PE = Preds.end();
> >        PI != PE; ++PI) {
> >     MachineBasicBlock *PredBB = *PI;
> > -    if (std::find(TDBBs.begin(), TDBBs.end(), PredBB) != TDBBs.end())
> > +    if (is_contained(TDBBs, PredBB))
> >       continue;
> >
> >     // EH edges
> >
> > Modified: llvm/trunk/lib/CodeGen/TargetInstrInfo.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/TargetInstrInfo.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/TargetInstrInfo.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/TargetInstrInfo.cpp Thu Aug 11 17:21:41 2016
> > @@ -467,7 +467,7 @@ static MachineInstr *foldPatchpoint(Mach
> >
> >   for (unsigned i = StartIdx; i < MI.getNumOperands(); ++i) {
> >     MachineOperand &MO = MI.getOperand(i);
> > -    if (std::find(Ops.begin(), Ops.end(), i) != Ops.end()) {
> > +    if (is_contained(Ops, i)) {
> >       unsigned SpillSize;
> >       unsigned SpillOffset;
> >       // Compute the spill slot size and offset.
> >
> > Modified: llvm/trunk/lib/CodeGen/TargetRegisterInfo.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/TargetRegisterInfo.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/TargetRegisterInfo.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/TargetRegisterInfo.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -354,7 +354,7 @@ TargetRegisterInfo::getRegAllocationHint
> >   // Check that Phys is in the allocation order. We shouldn't heed hints
> >   // from VirtReg's register class if they aren't in the allocation
> order. The
> >   // target probably has a reason for removing the register.
> > -  if (std::find(Order.begin(), Order.end(), Phys) == Order.end())
> > +  if (!is_contained(Order, Phys))
> >     return;
> >
> >   // All clear, tell the register allocator to prefer this register.
> >
> > Modified: llvm/trunk/lib/IR/LegacyPassManager.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/
> LegacyPassManager.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/IR/LegacyPassManager.cpp (original)
> > +++ llvm/trunk/lib/IR/LegacyPassManager.cpp Thu Aug 11 17:21:41 2016
> > @@ -841,9 +841,7 @@ bool PMDataManager::preserveHigherLevelA
> >          E = HigherLevelAnalysis.end(); I  != E; ++I) {
> >     Pass *P1 = *I;
> >     if (P1->getAsImmutablePass() == nullptr &&
> > -        std::find(PreservedSet.begin(), PreservedSet.end(),
> > -                  P1->getPassID()) ==
> > -           PreservedSet.end())
> > +        !is_contained(PreservedSet, P1->getPassID()))
> >       return false;
> >   }
> >
> > @@ -881,8 +879,7 @@ void PMDataManager::removeNotPreservedAn
> >          E = AvailableAnalysis.end(); I != E; ) {
> >     DenseMap<AnalysisID, Pass*>::iterator Info = I++;
> >     if (Info->second->getAsImmutablePass() == nullptr &&
> > -        std::find(PreservedSet.begin(), PreservedSet.end(),
> Info->first) ==
> > -        PreservedSet.end()) {
> > +        !is_contained(PreservedSet, Info->first)) {
> >       // Remove this analysis
> >       if (PassDebugging >= Details) {
> >         Pass *S = Info->second;
> > @@ -905,8 +902,7 @@ void PMDataManager::removeNotPreservedAn
> >            E = InheritedAnalysis[Index]->end(); I != E; ) {
> >       DenseMap<AnalysisID, Pass *>::iterator Info = I++;
> >       if (Info->second->getAsImmutablePass() == nullptr &&
> > -          std::find(PreservedSet.begin(), PreservedSet.end(),
> Info->first) ==
> > -             PreservedSet.end()) {
> > +          !is_contained(PreservedSet, Info->first)) {
> >         // Remove this analysis
> >         if (PassDebugging >= Details) {
> >           Pass *S = Info->second;
> >
> > Modified: llvm/trunk/lib/IR/PassRegistry.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/
> PassRegistry.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/IR/PassRegistry.cpp (original)
> > +++ llvm/trunk/lib/IR/PassRegistry.cpp Thu Aug 11 17:21:41 2016
> > @@ -13,6 +13,7 @@
> > //===-------------------------------------------------------
> ---------------===//
> >
> > #include "llvm/PassRegistry.h"
> > +#include "llvm/ADT/STLExtras.h"
> > #include "llvm/PassSupport.h"
> > #include "llvm/Support/ManagedStatic.h"
> >
> > @@ -121,6 +122,6 @@ void PassRegistry::addRegistrationListen
> > void PassRegistry::removeRegistrationListener(PassRegistrationListener
> *L) {
> >   sys::SmartScopedWriter<true> Guard(Lock);
> >
> > -  auto I = std::find(Listeners.begin(), Listeners.end(), L);
> > +  auto I = find(Listeners, L);
> >   Listeners.erase(I);
> > }
> >
> > Modified: llvm/trunk/lib/Option/OptTable.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Option/
> OptTable.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Option/OptTable.cpp (original)
> > +++ llvm/trunk/lib/Option/OptTable.cpp Thu Aug 11 17:21:41 2016
> > @@ -8,6 +8,7 @@
> > //===-------------------------------------------------------
> ---------------===//
> >
> > #include "llvm/Option/OptTable.h"
> > +#include "llvm/ADT/STLExtras.h"
> > #include "llvm/Option/Arg.h"
> > #include "llvm/Option/ArgList.h"
> > #include "llvm/Option/Option.h"
> > @@ -142,8 +143,7 @@ OptTable::OptTable(ArrayRef<Info> Option
> >     StringRef Prefix = I->getKey();
> >     for (StringRef::const_iterator C = Prefix.begin(), CE = Prefix.end();
> >                                    C != CE; ++C)
> > -      if (std::find(PrefixChars.begin(), PrefixChars.end(), *C)
> > -            == PrefixChars.end())
> > +      if (!is_contained(PrefixChars, *C))
> >         PrefixChars.push_back(*C);
> >   }
> > }
> >
> > Modified: llvm/trunk/lib/Support/CommandLine.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Support/CommandLine.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Support/CommandLine.cpp (original)
> > +++ llvm/trunk/lib/Support/CommandLine.cpp Thu Aug 11 17:21:41 2016
> > @@ -2101,7 +2101,7 @@ void cl::AddExtraVersionPrinter(void (*f
> > StringMap<Option *> &cl::getRegisteredOptions(SubCommand &Sub) {
> >   auto &Subs = GlobalParser->RegisteredSubCommands;
> >   (void)Subs;
> > -  assert(std::find(Subs.begin(), Subs.end(), &Sub) != Subs.end());
> > +  assert(is_contained(Subs, &Sub));
> >   return Sub.OptionsMap;
> > }
> >
> >
> > Modified: llvm/trunk/lib/Support/YAMLParser.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Support/YAMLParser.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Support/YAMLParser.cpp (original)
> > +++ llvm/trunk/lib/Support/YAMLParser.cpp Thu Aug 11 17:21:41 2016
> > @@ -12,6 +12,7 @@
> > //===-------------------------------------------------------
> ---------------===//
> >
> > #include "llvm/Support/YAMLParser.h"
> > +#include "llvm/ADT/STLExtras.h"
> > #include "llvm/ADT/SmallString.h"
> > #include "llvm/ADT/SmallVector.h"
> > #include "llvm/ADT/StringExtras.h"
> > @@ -802,8 +803,7 @@ Token &Scanner::peekNext() {
> >     removeStaleSimpleKeyCandidates();
> >     SimpleKey SK;
> >     SK.Tok = TokenQueue.begin();
> > -    if (std::find(SimpleKeys.begin(), SimpleKeys.end(), SK)
> > -        == SimpleKeys.end())
> > +    if (!is_contained(SimpleKeys, SK))
> >       break;
> >     else
> >       NeedMore = true;
> >
> > Modified: llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> AArch64/AArch64ISelLowering.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp (original)
> > +++ llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -4976,7 +4976,7 @@ SDValue AArch64TargetLowering::Reconstru
> >
> >     // Add this element source to the list if it's not already there.
> >     SDValue SourceVec = V.getOperand(0);
> > -    auto Source = std::find(Sources.begin(), Sources.end(), SourceVec);
> > +    auto Source = find(Sources, SourceVec);
> >     if (Source == Sources.end())
> >       Source = Sources.insert(Sources.end(),
> ShuffleSourceInfo(SourceVec));
> >
> > @@ -5092,7 +5092,7 @@ SDValue AArch64TargetLowering::Reconstru
> >     if (Entry.isUndef())
> >       continue;
> >
> > -    auto Src = std::find(Sources.begin(), Sources.end(),
> Entry.getOperand(0));
> > +    auto Src = find(Sources, Entry.getOperand(0));
> >     int EltNo = cast<ConstantSDNode>(Entry.
> getOperand(1))->getSExtValue();
> >
> >     // EXTRACT_VECTOR_ELT performs an implicit any_ext; BUILD_VECTOR an
> implicit
> >
> > Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> AMDGPU/AMDGPUPromoteAlloca.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp (original)
> > +++ llvm/trunk/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -535,7 +535,7 @@ bool AMDGPUPromoteAlloca::collectUsesWit
> >   std::vector<Value*> &WorkList) const {
> >
> >   for (User *User : Val->users()) {
> > -    if (std::find(WorkList.begin(), WorkList.end(), User) !=
> WorkList.end())
> > +    if (is_contained(WorkList, User))
> >       continue;
> >
> >     if (CallInst *CI = dyn_cast<CallInst>(User)) {
> >
> > Modified: llvm/trunk/lib/Target/AMDGPU/R600OptimizeVectorRegisters.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/
> R600OptimizeVectorRegisters.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/AMDGPU/R600OptimizeVectorRegisters.cpp
> (original)
> > +++ llvm/trunk/lib/Target/AMDGPU/R600OptimizeVectorRegisters.cpp Thu
> Aug 11 17:21:41 2016
> > @@ -200,12 +200,10 @@ MachineInstr *R600VectorRegMerger::Rebui
> >         .addReg(SubReg)
> >         .addImm(Chan);
> >     UpdatedRegToChan[SubReg] = Chan;
> > -    std::vector<unsigned>::iterator ChanPos =
> > -        std::find(UpdatedUndef.begin(), UpdatedUndef.end(), Chan);
> > +    std::vector<unsigned>::iterator ChanPos = find(UpdatedUndef, Chan);
> >     if (ChanPos != UpdatedUndef.end())
> >       UpdatedUndef.erase(ChanPos);
> > -    assert(std::find(UpdatedUndef.begin(), UpdatedUndef.end(), Chan) ==
> > -               UpdatedUndef.end() &&
> > +    assert(!is_contained(UpdatedUndef, Chan) &&
> >            "UpdatedUndef shouldn't contain Chan more than once!");
> >     DEBUG(dbgs() << "    ->"; Tmp->dump(););
> >     (void)Tmp;
> > @@ -236,12 +234,12 @@ void R600VectorRegMerger::RemoveMI(Machi
> >   for (InstructionSetMap::iterator It = PreviousRegSeqByReg.begin(),
> >       E = PreviousRegSeqByReg.end(); It != E; ++It) {
> >     std::vector<MachineInstr *> &MIs = (*It).second;
> > -    MIs.erase(std::find(MIs.begin(), MIs.end(), MI), MIs.end());
> > +    MIs.erase(find(MIs, MI), MIs.end());
> >   }
> >   for (InstructionSetMap::iterator It = PreviousRegSeqByUndefCount.
> begin(),
> >       E = PreviousRegSeqByUndefCount.end(); It != E; ++It) {
> >     std::vector<MachineInstr *> &MIs = (*It).second;
> > -    MIs.erase(std::find(MIs.begin(), MIs.end(), MI), MIs.end());
> > +    MIs.erase(find(MIs, MI), MIs.end());
> >   }
> > }
> >
> >
> > Modified: llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> AMDGPU/SIAnnotateControlFlow.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp (original)
> > +++ llvm/trunk/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -363,7 +363,7 @@ void SIAnnotateControlFlow::closeControl
> >
> >     std::vector<BasicBlock*> Preds;
> >     for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE;
> ++PI) {
> > -      if (std::find(Latches.begin(), Latches.end(), *PI) ==
> Latches.end())
> > +      if (!is_contained(Latches, *PI))
> >         Preds.push_back(*PI);
> >     }
> >     BB = llvm::SplitBlockPredecessors(BB, Preds, "endcf.split", DT, LI,
> false);
> >
> > Modified: llvm/trunk/lib/Target/AMDGPU/SIMachineScheduler.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> AMDGPU/SIMachineScheduler.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/AMDGPU/SIMachineScheduler.cpp (original)
> > +++ llvm/trunk/lib/Target/AMDGPU/SIMachineScheduler.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -479,8 +479,7 @@ void SIScheduleBlock::releaseSuccessors(
> > void SIScheduleBlock::nodeScheduled(SUnit *SU) {
> >   // Is in TopReadySUs
> >   assert (!SU->NumPredsLeft);
> > -  std::vector<SUnit*>::iterator I =
> > -    std::find(TopReadySUs.begin(), TopReadySUs.end(), SU);
> > +  std::vector<SUnit *>::iterator I = find(TopReadySUs, SU);
> >   if (I == TopReadySUs.end()) {
> >     dbgs() << "Data Structure Bug in SI Scheduler\n";
> >     llvm_unreachable(nullptr);
> >
> > Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> ARM/ARMBaseRegisterInfo.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
> > +++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -289,8 +289,7 @@ ARMBaseRegisterInfo::getRegAllocationHin
> >   }
> >
> >   // First prefer the paired physreg.
> > -  if (PairedPhys &&
> > -      std::find(Order.begin(), Order.end(), PairedPhys) != Order.end())
> > +  if (PairedPhys && is_contained(Order, PairedPhys))
> >     Hints.push_back(PairedPhys);
> >
> >   // Then prefer even or odd registers.
> >
> > Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> ARM/ARMConstantIslandPass.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original)
> > +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -1432,7 +1432,7 @@ bool ARMConstantIslands::handleConstantP
> >     // it.  Check for this so it will be removed from the WaterList.
> >     // Also remove any entry from NewWaterList.
> >     MachineBasicBlock *WaterBB = &*--NewMBB->getIterator();
> > -    IP = std::find(WaterList.begin(), WaterList.end(), WaterBB);
> > +    IP = find(WaterList, WaterBB);
> >     if (IP != WaterList.end())
> >       NewWaterList.erase(WaterBB);
> >
> >
> > Modified: llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> ARM/ARMFrameLowering.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp (original)
> > +++ llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -1640,8 +1640,7 @@ void ARMFrameLowering::determineCalleeSa
> >       SavedRegs.set(ARM::LR);
> >       NumGPRSpills++;
> >       SmallVectorImpl<unsigned>::iterator LRPos;
> > -      LRPos = std::find(UnspilledCS1GPRs.begin(),
> UnspilledCS1GPRs.end(),
> > -                        (unsigned)ARM::LR);
> > +      LRPos = find(UnspilledCS1GPRs, (unsigned)ARM::LR);
> >       if (LRPos != UnspilledCS1GPRs.end())
> >         UnspilledCS1GPRs.erase(LRPos);
> >
> > @@ -1651,8 +1650,7 @@ void ARMFrameLowering::determineCalleeSa
> >
> >     if (hasFP(MF)) {
> >       SavedRegs.set(FramePtr);
> > -      auto FPPos = std::find(UnspilledCS1GPRs.begin(),
> UnspilledCS1GPRs.end(),
> > -                             FramePtr);
> > +      auto FPPos = find(UnspilledCS1GPRs, FramePtr);
> >       if (FPPos != UnspilledCS1GPRs.end())
> >         UnspilledCS1GPRs.erase(FPPos);
> >       NumGPRSpills++;
> >
> > Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> ARM/ARMISelLowering.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
> > +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -5915,7 +5915,7 @@ SDValue ARMTargetLowering::ReconstructSh
> >
> >     // Add this element source to the list if it's not already there.
> >     SDValue SourceVec = V.getOperand(0);
> > -    auto Source = std::find(Sources.begin(), Sources.end(), SourceVec);
> > +    auto Source = find(Sources, SourceVec);
> >     if (Source == Sources.end())
> >       Source = Sources.insert(Sources.end(),
> ShuffleSourceInfo(SourceVec));
> >
> > @@ -6031,7 +6031,7 @@ SDValue ARMTargetLowering::ReconstructSh
> >     if (Entry.isUndef())
> >       continue;
> >
> > -    auto Src = std::find(Sources.begin(), Sources.end(),
> Entry.getOperand(0));
> > +    auto Src = find(Sources, Entry.getOperand(0));
> >     int EltNo = cast<ConstantSDNode>(Entry.
> getOperand(1))->getSExtValue();
> >
> >     // EXTRACT_VECTOR_ELT performs an implicit any_ext; BUILD_VECTOR an
> implicit
> >
> > Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> ARM/ARMLoadStoreOptimizer.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp (original)
> > +++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -834,7 +834,7 @@ MachineInstr *ARMLoadStoreOpt::MergeOpsU
> >         assert(MO.isImplicit());
> >         unsigned DefReg = MO.getReg();
> >
> > -        if (std::find(ImpDefs.begin(), ImpDefs.end(), DefReg) !=
> ImpDefs.end())
> > +        if (is_contained(ImpDefs, DefReg))
> >           continue;
> >         // We can ignore cases where the super-reg is read and written.
> >         if (MI->readsRegister(DefReg))
> >
> > Modified: llvm/trunk/lib/Target/Hexagon/HexagonBitSimplify.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> Hexagon/HexagonBitSimplify.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/Hexagon/HexagonBitSimplify.cpp (original)
> > +++ llvm/trunk/lib/Target/Hexagon/HexagonBitSimplify.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -2665,7 +2665,7 @@ bool HexagonLoopRescheduling::processLoo
> >           if (UseI->getOperand(Idx+1).getMBB() != C.LB)
> >             BadUse = true;
> >         } else {
> > -          auto F = std::find(ShufIns.begin(), ShufIns.end(), UseI);
> > +          auto F = find(ShufIns, UseI);
> >           if (F == ShufIns.end())
> >             BadUse = true;
> >         }
> >
> > Modified: llvm/trunk/lib/Target/Hexagon/HexagonMachineScheduler.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/
> HexagonMachineScheduler.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/Hexagon/HexagonMachineScheduler.h (original)
> > +++ llvm/trunk/lib/Target/Hexagon/HexagonMachineScheduler.h Thu Aug 11
> 17:21:41 2016
> > @@ -94,9 +94,7 @@ public:
> >   void savePacket();
> >   unsigned getTotalPackets() const { return TotalPackets; }
> >
> > -  bool isInPacket(SUnit *SU) const {
> > -    return std::find(Packet.begin(), Packet.end(), SU) != Packet.end();
> > -  }
> > +  bool isInPacket(SUnit *SU) const { return is_contained(Packet, SU); }
> > };
> >
> > /// Extend the standard ScheduleDAGMI to provide more context and
> override the
> >
> > Modified: llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> Hexagon/HexagonVLIWPacketizer.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp (original)
> > +++ llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -1338,7 +1338,7 @@ bool HexagonPacketizerList::isLegalToPac
> >       // However, there is no dependence edge between (1)->(3). This
> results
> >       // in all 3 instructions going in the same packet. We ignore
> dependce
> >       // only once to avoid this situation.
> > -      auto Itr = std::find(IgnoreDepMIs.begin(), IgnoreDepMIs.end(),
> &J);
> > +      auto Itr = find(IgnoreDepMIs, &J);
> >       if (Itr != IgnoreDepMIs.end()) {
> >         Dependence = true;
> >         return false;
> >
> > Modified: llvm/trunk/lib/Target/Mips/MipsConstantIslandPass.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> Mips/MipsConstantIslandPass.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/Mips/MipsConstantIslandPass.cpp (original)
> > +++ llvm/trunk/lib/Target/Mips/MipsConstantIslandPass.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -1374,7 +1374,7 @@ bool MipsConstantIslands::handleConstant
> >     // it.  Check for this so it will be removed from the WaterList.
> >     // Also remove any entry from NewWaterList.
> >     MachineBasicBlock *WaterBB = &*--NewMBB->getIterator();
> > -    IP = std::find(WaterList.begin(), WaterList.end(), WaterBB);
> > +    IP = find(WaterList, WaterBB);
> >     if (IP != WaterList.end())
> >       NewWaterList.erase(WaterBB);
> >
> >
> > Modified: llvm/trunk/lib/Target/NVPTX/NVPTXUtilities.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> NVPTX/NVPTXUtilities.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/NVPTX/NVPTXUtilities.cpp (original)
> > +++ llvm/trunk/lib/Target/NVPTX/NVPTXUtilities.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -169,7 +169,7 @@ bool llvm::isSampler(const llvm::Value &
> >     if (llvm::findAllNVVMAnnotation(
> >             func, llvm::PropertyAnnotationNames[
> llvm::PROPERTY_ISSAMPLER],
> >             annot)) {
> > -      if (std::find(annot.begin(), annot.end(), arg->getArgNo()) !=
> annot.end())
> > +      if (is_contained(annot, arg->getArgNo()))
> >         return true;
> >     }
> >   }
> > @@ -184,7 +184,7 @@ bool llvm::isImageReadOnly(const llvm::V
> >                                     llvm::PropertyAnnotationNames[
> >                                         llvm::PROPERTY_ISREADONLY_
> IMAGE_PARAM],
> >                                     annot)) {
> > -      if (std::find(annot.begin(), annot.end(), arg->getArgNo()) !=
> annot.end())
> > +      if (is_contained(annot, arg->getArgNo()))
> >         return true;
> >     }
> >   }
> > @@ -199,7 +199,7 @@ bool llvm::isImageWriteOnly(const llvm::
> >                                     llvm::PropertyAnnotationNames[
> >                                         llvm::PROPERTY_ISWRITEONLY_
> IMAGE_PARAM],
> >                                     annot)) {
> > -      if (std::find(annot.begin(), annot.end(), arg->getArgNo()) !=
> annot.end())
> > +      if (is_contained(annot, arg->getArgNo()))
> >         return true;
> >     }
> >   }
> > @@ -214,7 +214,7 @@ bool llvm::isImageReadWrite(const llvm::
> >                                     llvm::PropertyAnnotationNames[
> >                                         llvm::PROPERTY_ISREADWRITE_
> IMAGE_PARAM],
> >                                     annot)) {
> > -      if (std::find(annot.begin(), annot.end(), arg->getArgNo()) !=
> annot.end())
> > +      if (is_contained(annot, arg->getArgNo()))
> >         return true;
> >     }
> >   }
> >
> > Modified: llvm/trunk/lib/Target/Sparc/LeonPasses.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> Sparc/LeonPasses.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/Sparc/LeonPasses.cpp (original)
> > +++ llvm/trunk/lib/Target/Sparc/LeonPasses.cpp Thu Aug 11 17:21:41 2016
> > @@ -51,8 +51,7 @@ int LEONMachineFunctionPass::GetRegIndex
> > int LEONMachineFunctionPass::getUnusedFPRegister(MachineRegisterInfo
> &MRI) {
> >   for (int RegisterIndex = SP::F0; RegisterIndex <= SP::F31;
> ++RegisterIndex) {
> >     if (!MRI.isPhysRegUsed(RegisterIndex) &&
> > -        !(std::find(UsedRegisters.begin(), UsedRegisters.end(),
> > -                    RegisterIndex) != UsedRegisters.end())) {
> > +        !is_contained(UsedRegisters, RegisterIndex)) {
> >       return RegisterIndex;
> >     }
> >   }
> >
> > Propchange: llvm/trunk/lib/Target/Sparc/LeonPasses.cpp
> > ------------------------------------------------------------
> ------------------
> > --- svn:executable (original)
> > +++ svn:executable (removed)
> > @@ -1 +0,0 @@
> > -*
> >
> > Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
> X86/X86ISelLowering.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
> > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -9553,18 +9553,15 @@ static SDValue lowerV8I16GeneralSingleIn
> >         auto FixFlippedInputs = [&V, &DL, &Mask, &DAG](int PinnedIdx,
> int DWord,
> >                                                        ArrayRef<int>
> Inputs) {
> >           int FixIdx = PinnedIdx ^ 1; // The adjacent slot to the pinned
> slot.
> > -          bool IsFixIdxInput = std::find(Inputs.begin(), Inputs.end(),
> > -                                         PinnedIdx ^ 1) != Inputs.end();
> > +          bool IsFixIdxInput = is_contained(Inputs, PinnedIdx ^ 1);
> >           // Determine whether the free index is in the flipped dword or
> the
> >           // unflipped dword based on where the pinned index is. We use
> this bit
> >           // in an xor to conditionally select the adjacent dword.
> >           int FixFreeIdx = 2 * (DWord ^ (PinnedIdx / 2 == DWord));
> > -          bool IsFixFreeIdxInput = std::find(Inputs.begin(),
> Inputs.end(),
> > -                                             FixFreeIdx) !=
> Inputs.end();
> > +          bool IsFixFreeIdxInput = is_contained(Inputs, FixFreeIdx);
> >           if (IsFixIdxInput == IsFixFreeIdxInput)
> >             FixFreeIdx += 1;
> > -          IsFixFreeIdxInput = std::find(Inputs.begin(), Inputs.end(),
> > -                                        FixFreeIdx) != Inputs.end();
> > +          IsFixFreeIdxInput = is_contained(Inputs, FixFreeIdx);
> >           assert(IsFixIdxInput != IsFixFreeIdxInput &&
> >                  "We need to be changing the number of flipped inputs!");
> >           int PSHUFHalfMask[] = {0, 1, 2, 3};
> >
> > Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Transforms/Scalar/JumpThreading.cpp?rev=278433&
> r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
> > +++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -1167,8 +1167,7 @@ FindMostPopularDest(BasicBlock *BB,
> >     for (unsigned i = 0; ; ++i) {
> >       assert(i != TI->getNumSuccessors() && "Didn't find any
> successor!");
> >
> > -      if (std::find(SamePopularity.begin(), SamePopularity.end(),
> > -                    TI->getSuccessor(i)) == SamePopularity.end())
> > +      if (!is_contained(SamePopularity, TI->getSuccessor(i)))
> >         continue;
> >
> >       MostPopularDest = TI->getSuccessor(i);
> >
> > Modified: llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Transforms/Scalar/LoopRerollPass.cpp?rev=278433&
> r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp (original)
> > +++ llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -878,7 +878,7 @@ findRootsRecursive(Instruction *I, Small
> >
> >   for (User *V : I->users()) {
> >     Instruction *I = dyn_cast<Instruction>(V);
> > -    if (std::find(LoopIncs.begin(), LoopIncs.end(), I) !=
> LoopIncs.end())
> > +    if (is_contained(LoopIncs, I))
> >       continue;
> >
> >     if (!I || !isSimpleArithmeticOp(I) ||
> > @@ -1088,7 +1088,7 @@ bool LoopReroll::DAGRootTracker::isBaseI
> >
> > bool LoopReroll::DAGRootTracker::isRootInst(Instruction *I) {
> >   for (auto &DRS : RootSets) {
> > -    if (std::find(DRS.Roots.begin(), DRS.Roots.end(), I) !=
> DRS.Roots.end())
> > +    if (is_contained(DRS.Roots, I))
> >       return true;
> >   }
> >   return false;
> >
> > Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Transforms/Scalar/LoopStrengthReduce.cpp?rev=278433&r1=278432&r2=278433&
> view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
> > +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -448,8 +448,7 @@ void Formula::deleteBaseReg(const SCEV *
> >
> > /// Test if this formula references the given register.
> > bool Formula::referencesReg(const SCEV *S) const {
> > -  return S == ScaledReg ||
> > -         std::find(BaseRegs.begin(), BaseRegs.end(), S) !=
> BaseRegs.end();
> > +  return S == ScaledReg || is_contained(BaseRegs, S);
> > }
> >
> > /// Test whether this formula uses registers which are used by uses
> other than
> > @@ -4231,8 +4230,7 @@ void LSRInstance::SolveRecurse(SmallVect
> >     int NumReqRegsToFind = std::min(F.getNumRegs(), ReqRegs.size());
> >     for (const SCEV *Reg : ReqRegs) {
> >       if ((F.ScaledReg && F.ScaledReg == Reg) ||
> > -          std::find(F.BaseRegs.begin(), F.BaseRegs.end(), Reg) !=
> > -          F.BaseRegs.end()) {
> > +          is_contained(F.BaseRegs, Reg)) {
> >         --NumReqRegsToFind;
> >         if (NumReqRegsToFind == 0)
> >           break;
> >
> > Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=278433&r1=278432&r2=
> 278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
> (original)
> > +++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Thu
> Aug 11 17:21:41 2016
> > @@ -1154,7 +1154,7 @@ static void CreateGCRelocates(ArrayRef<V
> >     return;
> >
> >   auto FindIndex = [](ArrayRef<Value *> LiveVec, Value *Val) {
> > -    auto ValIt = std::find(LiveVec.begin(), LiveVec.end(), Val);
> > +    auto ValIt = find(LiveVec, Val);
> >     assert(ValIt != LiveVec.end() && "Val not found in LiveVec!");
> >     size_t Index = std::distance(LiveVec.begin(), ValIt);
> >     assert(Index < LiveVec.size() && "Bug in std::find?");
> > @@ -1929,8 +1929,7 @@ static void rematerializeLiveValues(Call
> >           // Assert that cloned instruction does not use any
> instructions from
> >           // this chain other than LastClonedValue
> >           for (auto OpValue : ClonedValue->operand_values()) {
> > -            assert(std::find(ChainToBase.begin(), ChainToBase.end(),
> OpValue) ==
> > -                       ChainToBase.end() &&
> > +            assert(!is_contained(ChainToBase, OpValue) &&
> >                    "incorrect use in rematerialization chain");
> >           }
> > #endif
> >
> > Modified: llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Transforms/Scalar/StructurizeCFG.cpp?rev=278433&
> r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp (original)
> > +++ llvm/trunk/lib/Transforms/Scalar/StructurizeCFG.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -321,7 +321,7 @@ void StructurizeCFG::orderNodes() {
> >     BasicBlock *BB = (*I)->getEntry();
> >     unsigned LoopDepth = LI->getLoopDepth(BB);
> >
> > -    if (std::find(Order.begin(), Order.end(), *I) != Order.end())
> > +    if (is_contained(Order, *I))
> >       continue;
> >
> >     if (LoopDepth < CurrentLoopDepth) {
> >
> > Modified: llvm/trunk/lib/Transforms/Utils/Evaluator.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Transforms/Utils/Evaluator.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Transforms/Utils/Evaluator.cpp (original)
> > +++ llvm/trunk/lib/Transforms/Utils/Evaluator.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -537,7 +537,7 @@ bool Evaluator::EvaluateFunction(Functio
> >                                  const SmallVectorImpl<Constant*>
> &ActualArgs) {
> >   // Check to see if this function is already executing (recursion).  If
> so,
> >   // bail out.  TODO: we might want to accept limited recursion.
> > -  if (std::find(CallStack.begin(), CallStack.end(), F) !=
> CallStack.end())
> > +  if (is_contained(CallStack, F))
> >     return false;
> >
> >   CallStack.push_back(F);
> >
> > Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Transforms/Utils/LCSSA.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original)
> > +++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Thu Aug 11 17:21:41 2016
> > @@ -54,7 +54,7 @@ STATISTIC(NumLCSSA, "Number of live out
> > /// Return true if the specified block is in the list.
> > static bool isExitBlock(BasicBlock *BB,
> >                         const SmallVectorImpl<BasicBlock *> &ExitBlocks)
> {
> > -  return find(ExitBlocks, BB) != ExitBlocks.end();
> > +  return is_contained(ExitBlocks, BB);
> > }
> >
> > /// For every instruction from the worklist, check to see if it has any
> uses
> >
> > Modified: llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Transforms/Utils/SSAUpdater.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp (original)
> > +++ llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -482,5 +482,5 @@ bool
> > LoadAndStorePromoter::isInstInList(Instruction *I,
> >                                    const SmallVectorImpl<Instruction*>
> &Insts)
> >                                    const {
> > -  return std::find(Insts.begin(), Insts.end(), I) != Insts.end();
> > +  return is_contained(Insts, I);
> > }
> >
> > Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> Transforms/Vectorize/SLPVectorizer.cpp?rev=278433&
> r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
> > +++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -954,8 +954,7 @@ void BoUpSLP::buildTree(ArrayRef<Value *
> >         }
> >
> >         // Ignore users in the user ignore list.
> > -        if (std::find(UserIgnoreList.begin(), UserIgnoreList.end(),
> UserInst) !=
> > -            UserIgnoreList.end())
> > +        if (is_contained(UserIgnoreList, UserInst))
> >           continue;
> >
> >         DEBUG(dbgs() << "SLP: Need to extract:" << *U << " from lane " <<
> > @@ -2726,8 +2725,7 @@ Value *BoUpSLP::vectorizeTree() {
> >
> >           assert((ScalarToTreeEntry.count(U) ||
> >                   // It is legal to replace users in the ignorelist by
> undef.
> > -                  (std::find(UserIgnoreList.begin(),
> UserIgnoreList.end(), U) !=
> > -                   UserIgnoreList.end())) &&
> > +                  is_contained(UserIgnoreList, U)) &&
> >                  "Replacing out-of-tree value with undef");
> >         }
> > #endif
> > @@ -2820,7 +2818,7 @@ void BoUpSLP::optimizeGatherSequence() {
> >         }
> >       }
> >       if (In) {
> > -        assert(std::find(Visited.begin(), Visited.end(), In) ==
> Visited.end());
> > +        assert(!is_contained(Visited, In));
> >         Visited.push_back(In);
> >       }
> >     }
> >
> > Modified: llvm/trunk/tools/bugpoint/CrashDebugger.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/
> bugpoint/CrashDebugger.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/tools/bugpoint/CrashDebugger.cpp (original)
> > +++ llvm/trunk/tools/bugpoint/CrashDebugger.cpp Thu Aug 11 17:21:41 2016
> > @@ -239,9 +239,7 @@ static void RemoveFunctionReferences(Mod
> >
> > bool ReduceCrashingFunctions::TestFuncs(std::vector<Function*> &Funcs) {
> >   // If main isn't present, claim there is no problem.
> > -  if (KeepMain && std::find(Funcs.begin(), Funcs.end(),
> > -                            BD.getProgram()->getFunction("main")) ==
> > -                      Funcs.end())
> > +  if (KeepMain && !is_contained(Funcs, BD.getProgram()->getFunction("
> main")))
> >     return false;
> >
> >   // Clone the program to try hacking it apart...
> >
> > Modified: llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/
> dsymutil/MachODebugMapParser.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp (original)
> > +++ llvm/trunk/tools/dsymutil/MachODebugMapParser.cpp Thu Aug 11
> 17:21:41 2016
> > @@ -285,20 +285,17 @@ void MachODebugMapParser::dumpOneBinaryS
> > }
> >
> > static bool shouldLinkArch(SmallVectorImpl<StringRef> &Archs, StringRef
> Arch) {
> > -  if (Archs.empty() ||
> > -      std::find(Archs.begin(), Archs.end(), "all") != Archs.end() ||
> > -      std::find(Archs.begin(), Archs.end(), "*") != Archs.end())
> > +  if (Archs.empty() || is_contained(Archs, "all") ||
> is_contained(Archs, "*"))
> >     return true;
> >
> > -  if (Arch.startswith("arm") && Arch != "arm64" &&
> > -      std::find(Archs.begin(), Archs.end(), "arm") != Archs.end())
> > +  if (Arch.startswith("arm") && Arch != "arm64" && is_contained(Archs,
> "arm"))
> >     return true;
> >
> >   SmallString<16> ArchName = Arch;
> >   if (Arch.startswith("thumb"))
> >     ArchName = ("arm" + Arch.substr(5)).str();
> >
> > -  return std::find(Archs.begin(), Archs.end(), ArchName) != Archs.end();
> > +  return is_contained(Archs, ArchName);
> > }
> >
> > bool MachODebugMapParser::dumpStab() {
> >
> > Modified: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
> ar/llvm-ar.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/tools/llvm-ar/llvm-ar.cpp (original)
> > +++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp Thu Aug 11 17:21:41 2016
> > @@ -429,7 +429,7 @@ static void performReadOperation(Archive
> >       StringRef Name = NameOrErr.get();
> >
> >       if (Filter) {
> > -        auto I = std::find(Members.begin(), Members.end(), Name);
> > +        auto I = find(Members, Name);
> >         if (I == Members.end())
> >           continue;
> >         Members.erase(I);
> >
> > Modified: llvm/trunk/unittests/ExecutionEngine/MCJIT/
> MCJITTestAPICommon.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/
> ExecutionEngine/MCJIT/MCJITTestAPICommon.h?rev=278433&r1=278432&r2=278433&
> view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h
> (original)
> > +++ llvm/trunk/unittests/ExecutionEngine/MCJIT/MCJITTestAPICommon.h Thu
> Aug 11 17:21:41 2016
> > @@ -15,6 +15,7 @@
> > #ifndef LLVM_UNITTESTS_EXECUTIONENGINE_MCJIT_MCJITTESTAPICOMMON_H
> > #define LLVM_UNITTESTS_EXECUTIONENGINE_MCJIT_MCJITTESTAPICOMMON_H
> >
> > +#include "llvm/ADT/STLExtras.h"
> > #include "llvm/ADT/SmallVector.h"
> > #include "llvm/ADT/Triple.h"
> > #include "llvm/IR/LegacyPassManager.h"
> > @@ -56,13 +57,11 @@ protected:
> >   bool ArchSupportsMCJIT() {
> >     Triple Host(HostTriple);
> >     // If ARCH is not supported, bail
> > -    if (std::find(SupportedArchs.begin(), SupportedArchs.end(),
> Host.getArch())
> > -        == SupportedArchs.end())
> > +    if (!is_contained(SupportedArchs, Host.getArch()))
> >       return false;
> >
> >     // If ARCH is supported and has no specific sub-arch support
> > -    if (std::find(HasSubArchs.begin(), HasSubArchs.end(),
> Host.getArch())
> > -        == HasSubArchs.end())
> > +    if (!is_contained(HasSubArchs, Host.getArch()))
> >       return true;
> >
> >     // If ARCH has sub-arch support, find it
> > @@ -78,12 +77,11 @@ protected:
> >   bool OSSupportsMCJIT() {
> >     Triple Host(HostTriple);
> >
> > -    if (std::find(UnsupportedEnvironments.begin(),
> UnsupportedEnvironments.end(),
> > -                  Host.getEnvironment()) !=
> UnsupportedEnvironments.end())
> > +    if (find(UnsupportedEnvironments, Host.getEnvironment()) !=
> > +        UnsupportedEnvironments.end())
> >       return false;
> >
> > -    if (std::find(UnsupportedOSs.begin(), UnsupportedOSs.end(),
> Host.getOS())
> > -        == UnsupportedOSs.end())
> > +    if (!is_contained(UnsupportedOSs, Host.getOS()))
> >       return true;
> >
> >     return false;
> >
> > Modified: llvm/trunk/unittests/Support/Path.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/
> Support/Path.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/unittests/Support/Path.cpp (original)
> > +++ llvm/trunk/unittests/Support/Path.cpp Thu Aug 11 17:21:41 2016
> > @@ -8,6 +8,7 @@
> > //===-------------------------------------------------------
> ---------------===//
> >
> > #include "llvm/Support/Path.h"
> > +#include "llvm/ADT/STLExtras.h"
> > #include "llvm/Support/ConvertUTF.h"
> > #include "llvm/Support/Errc.h"
> > #include "llvm/Support/ErrorHandling.h"
> > @@ -677,16 +678,15 @@ TEST_F(FileSystemTest, DirectoryIteratio
> >       i.no_push();
> >     visited.push_back(path::filename(i->path()));
> >   }
> > -  v_t::const_iterator a0 = std::find(visited.begin(), visited.end(),
> "a0");
> > -  v_t::const_iterator aa1 = std::find(visited.begin(), visited.end(),
> "aa1");
> > -  v_t::const_iterator ab1 = std::find(visited.begin(), visited.end(),
> "ab1");
> > -  v_t::const_iterator dontlookhere = std::find(visited.begin(),
> visited.end(),
> > -                                               "dontlookhere");
> > -  v_t::const_iterator da1 = std::find(visited.begin(), visited.end(),
> "da1");
> > -  v_t::const_iterator z0 = std::find(visited.begin(), visited.end(),
> "z0");
> > -  v_t::const_iterator za1 = std::find(visited.begin(), visited.end(),
> "za1");
> > -  v_t::const_iterator pop = std::find(visited.begin(), visited.end(),
> "pop");
> > -  v_t::const_iterator p1 = std::find(visited.begin(), visited.end(),
> "p1");
> > +  v_t::const_iterator a0 = find(visited, "a0");
> > +  v_t::const_iterator aa1 = find(visited, "aa1");
> > +  v_t::const_iterator ab1 = find(visited, "ab1");
> > +  v_t::const_iterator dontlookhere = find(visited, "dontlookhere");
> > +  v_t::const_iterator da1 = find(visited, "da1");
> > +  v_t::const_iterator z0 = find(visited, "z0");
> > +  v_t::const_iterator za1 = find(visited, "za1");
> > +  v_t::const_iterator pop = find(visited, "pop");
> > +  v_t::const_iterator p1 = find(visited, "p1");
> >
> >   // Make sure that each path was visited correctly.
> >   ASSERT_NE(a0, visited.end());
> >
> > Modified: llvm/trunk/unittests/Support/ThreadPool.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/
> Support/ThreadPool.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/unittests/Support/ThreadPool.cpp (original)
> > +++ llvm/trunk/unittests/Support/ThreadPool.cpp Thu Aug 11 17:21:41 2016
> > @@ -31,16 +31,14 @@ protected:
> >   bool isUnsupportedOSOrEnvironment() {
> >     Triple Host(Triple::normalize(sys::getProcessTriple()));
> >
> > -    if (std::find(UnsupportedEnvironments.begin(),
> UnsupportedEnvironments.end(),
> > -                  Host.getEnvironment()) !=
> UnsupportedEnvironments.end())
> > +    if (find(UnsupportedEnvironments, Host.getEnvironment()) !=
> > +        UnsupportedEnvironments.end())
> >       return true;
> >
> > -    if (std::find(UnsupportedOSs.begin(), UnsupportedOSs.end(),
> Host.getOS())
> > -        != UnsupportedOSs.end())
> > +    if (is_contained(UnsupportedOSs, Host.getOS()))
> >       return true;
> >
> > -    if (std::find(UnsupportedArchs.begin(), UnsupportedArchs.end(),
> Host.getArch())
> > -        != UnsupportedArchs.end())
> > +    if (is_contained(UnsupportedArchs, Host.getArch()))
> >       return true;
> >
> >     return false;
> >
> > Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/
> TableGen/AsmMatcherEmitter.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
> > +++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -1819,8 +1819,7 @@ static unsigned getConverterOperandID(co
> >                                       bool &IsNew) {
> >   IsNew = Table.insert(Name);
> >
> > -  unsigned ID = IsNew ? Table.size() - 1 :
> > -    std::find(Table.begin(), Table.end(), Name) - Table.begin();
> > +  unsigned ID = IsNew ? Table.size() - 1 : find(Table, Name) -
> Table.begin();
> >
> >   assert(ID < Table.size());
> >
> >
> > Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/
> TableGen/CodeGenDAGPatterns.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h (original)
> > +++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h Thu Aug 11 17:21:41
> 2016
> > @@ -412,8 +412,7 @@ public:
> >   }
> >   void addPredicateFn(const TreePredicateFn &Fn) {
> >     assert(!Fn.isAlwaysTrue() && "Empty predicate string!");
> > -    if (std::find(PredicateFns.begin(), PredicateFns.end(), Fn) ==
> > -          PredicateFns.end())
> > +    if (!is_contained(PredicateFns, Fn))
> >       PredicateFns.push_back(Fn);
> >   }
> >
> >
> > Modified: llvm/trunk/utils/TableGen/CodeGenRegisters.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/
> TableGen/CodeGenRegisters.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/utils/TableGen/CodeGenRegisters.cpp (original)
> > +++ llvm/trunk/utils/TableGen/CodeGenRegisters.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -1756,8 +1756,7 @@ void CodeGenRegBank::computeRegUnitSets(
> >     std::vector<unsigned> RUSets;
> >     for (unsigned i = 0, e = RegUnitSets.size(); i != e; ++i) {
> >       RegUnitSet &RUSet = RegUnitSets[i];
> > -      if (std::find(RUSet.Units.begin(), RUSet.Units.end(), UnitIdx)
> > -          == RUSet.Units.end())
> > +      if (!is_contained(RUSet.Units, UnitIdx))
> >         continue;
> >       RUSets.push_back(i);
> >     }
> >
> > Modified: llvm/trunk/utils/TableGen/CodeGenSchedule.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/
> TableGen/CodeGenSchedule.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/utils/TableGen/CodeGenSchedule.cpp (original)
> > +++ llvm/trunk/utils/TableGen/CodeGenSchedule.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -356,8 +356,7 @@ bool CodeGenSchedModels::hasReadOfWrite(
> >       continue;
> >
> >     RecVec ValidWrites = ReadDef->getValueAsListOfDefs("ValidWrites");
> > -    if (std::find(ValidWrites.begin(), ValidWrites.end(), WriteDef)
> > -        != ValidWrites.end()) {
> > +    if (is_contained(ValidWrites, WriteDef)) {
> >       return true;
> >     }
> >   }
> > @@ -1400,8 +1399,7 @@ bool CodeGenSchedModels::hasSuperGroup(R
> >       PM.ProcResourceDefs[i]->getValueAsListOfDefs("Resources");
> >     RecIter RI = SubUnits.begin(), RE = SubUnits.end();
> >     for ( ; RI != RE; ++RI) {
> > -      if (std::find(SuperUnits.begin(), SuperUnits.end(), *RI)
> > -          == SuperUnits.end()) {
> > +      if (!is_contained(SuperUnits, *RI)) {
> >         break;
> >       }
> >     }
> > @@ -1741,7 +1739,7 @@ void CodeGenSchedModels::addWriteRes(Rec
> >   assert(PIdx && "don't add resources to an invalid Processor model");
> >
> >   RecVec &WRDefs = ProcModels[PIdx].WriteResDefs;
> > -  RecIter WRI = std::find(WRDefs.begin(), WRDefs.end(),
> ProcWriteResDef);
> > +  RecIter WRI = find(WRDefs, ProcWriteResDef);
> >   if (WRI != WRDefs.end())
> >     return;
> >   WRDefs.push_back(ProcWriteResDef);
> > @@ -1758,15 +1756,14 @@ void CodeGenSchedModels::addWriteRes(Rec
> > void CodeGenSchedModels::addReadAdvance(Record *ProcReadAdvanceDef,
> >                                         unsigned PIdx) {
> >   RecVec &RADefs = ProcModels[PIdx].ReadAdvanceDefs;
> > -  RecIter I = std::find(RADefs.begin(), RADefs.end(),
> ProcReadAdvanceDef);
> > +  RecIter I = find(RADefs, ProcReadAdvanceDef);
> >   if (I != RADefs.end())
> >     return;
> >   RADefs.push_back(ProcReadAdvanceDef);
> > }
> >
> > unsigned CodeGenProcModel::getProcResourceIdx(Record *PRDef) const {
> > -  RecIter PRPos = std::find(ProcResourceDefs.begin(),
> ProcResourceDefs.end(),
> > -                            PRDef);
> > +  RecIter PRPos = find(ProcResourceDefs, PRDef);
> >   if (PRPos == ProcResourceDefs.end())
> >     PrintFatalError(PRDef->getLoc(), "ProcResource def is not included
> in "
> >                     "the ProcResources list for " + ModelName);
> >
> > Modified: llvm/trunk/utils/TableGen/CodeGenTarget.h
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/
> TableGen/CodeGenTarget.h?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/utils/TableGen/CodeGenTarget.h (original)
> > +++ llvm/trunk/utils/TableGen/CodeGenTarget.h Thu Aug 11 17:21:41 2016
> > @@ -139,7 +139,7 @@ public:
> >   /// supported by the target (i.e. there are registers that directly
> hold it).
> >   bool isLegalValueType(MVT::SimpleValueType VT) const {
> >     ArrayRef<MVT::SimpleValueType> LegalVTs = getLegalValueTypes();
> > -    return std::find(LegalVTs.begin(), LegalVTs.end(), VT) !=
> LegalVTs.end();
> > +    return is_contained(LegalVTs, VT);
> >   }
> >
> >   CodeGenSchedModels &getSchedModels() const;
> >
> > Modified: llvm/trunk/utils/TableGen/SubtargetEmitter.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/
> TableGen/SubtargetEmitter.cpp?rev=278433&r1=278432&r2=278433&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/utils/TableGen/SubtargetEmitter.cpp (original)
> > +++ llvm/trunk/utils/TableGen/SubtargetEmitter.cpp Thu Aug 11 17:21:41
> 2016
> > @@ -783,8 +783,7 @@ void SubtargetEmitter::ExpandProcResourc
> >       RecVec SuperResources = PR->getValueAsListOfDefs("Resources");
> >       RecIter SubI = SubResources.begin(), SubE = SubResources.end();
> >       for( ; SubI != SubE; ++SubI) {
> > -        if (std::find(SuperResources.begin(), SuperResources.end(),
> *SubI)
> > -            == SuperResources.end()) {
> > +        if (!is_contained(SuperResources, *SubI)) {
> >           break;
> >         }
> >       }
> > @@ -873,8 +872,7 @@ void SubtargetEmitter::GenSchedClassTabl
> >       // Check this processor's itinerary class resources.
> >       for (Record *I : ProcModel.ItinRWDefs) {
> >         RecVec Matched = I->getValueAsListOfDefs("MatchedItinClasses");
> > -        if (std::find(Matched.begin(), Matched.end(), SC.ItinClassDef)
> > -            != Matched.end()) {
> > +        if (is_contained(Matched, SC.ItinClassDef)) {
> >           SchedModels.findRWs(I->getValueAsListOfDefs("
> OperandReadWrites"),
> >                               Writes, Reads);
> >           break;
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160811/0d98fc32/attachment-0001.html>


More information about the llvm-commits mailing list