Index: llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp =================================================================== --- llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp +++ llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp @@ -18,7 +18,6 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" @@ -406,7 +405,7 @@ determinePointerReadAttrs(Argument *A, const SmallPtrSet &SCCNodes) { SmallVector Worklist; - SmallSet Visited; + SmallPtrSet Visited; // inalloca arguments are always clobbered by the call. if (A->hasInAllocaAttr()) Index: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp =================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp @@ -17,7 +17,6 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/Twine.h" @@ -1747,8 +1746,8 @@ return true; } -static bool deleteIfDead(GlobalValue &GV, - SmallSet &NotDiscardableComdats) { +static bool deleteIfDead( + GlobalValue &GV, SmallPtrSetImpl &NotDiscardableComdats) { GV.removeDeadConstantUsers(); if (!GV.isDiscardableIfUnused() && !GV.isDeclaration()) @@ -2228,7 +2227,7 @@ function_ref GetTTI, function_ref GetBFI, function_ref LookupDomTree, - SmallSet &NotDiscardableComdats) { + SmallPtrSetImpl &NotDiscardableComdats) { bool Changed = false; @@ -2323,7 +2322,7 @@ static bool OptimizeGlobalVars(Module &M, TargetLibraryInfo *TLI, function_ref LookupDomTree, - SmallSet &NotDiscardableComdats) { + SmallPtrSetImpl &NotDiscardableComdats) { bool Changed = false; for (Module::global_iterator GVI = M.global_begin(), E = M.global_end(); @@ -2566,7 +2565,7 @@ } static void setUsedInitializer(GlobalVariable &V, - const SmallPtrSet &Init) { + const SmallPtrSetImpl &Init) { if (Init.empty()) { V.eraseFromParent(); return; @@ -2719,7 +2718,7 @@ static bool OptimizeGlobalAliases(Module &M, - SmallSet &NotDiscardableComdats) { + SmallPtrSetImpl &NotDiscardableComdats) { bool Changed = false; LLVMUsed Used(M); @@ -2902,7 +2901,7 @@ function_ref GetTTI, function_ref GetBFI, function_ref LookupDomTree) { - SmallSet NotDiscardableComdats; + SmallPtrSet NotDiscardableComdats; bool Changed = false; bool LocalChange = true; while (LocalChange) { Index: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp =================================================================== --- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp +++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp @@ -90,7 +90,7 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/IR/Argument.h" @@ -874,7 +874,7 @@ void MergeFunctions::removeUsers(Value *V) { std::vector Worklist; Worklist.push_back(V); - SmallSet Visited; + SmallPtrSet Visited; Visited.insert(V); while (!Worklist.empty()) { Value *V = Worklist.back(); Index: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp =================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -16,7 +16,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DepthFirstIterator.h" -#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" @@ -2509,7 +2509,7 @@ // We want to instrument every address only once per basic block (unless there // are calls between uses). - SmallSet TempsToInstrument; + SmallPtrSet TempsToInstrument; SmallVector ToInstrument; SmallVector NoReturnCalls; SmallVector AllBlocks; Index: llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp =================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ llvm/trunk/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -19,7 +19,7 @@ // The rest is handled by the run-time library. //===----------------------------------------------------------------------===// -#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" @@ -339,7 +339,7 @@ void ThreadSanitizer::chooseInstructionsToInstrument( SmallVectorImpl &Local, SmallVectorImpl &All, const DataLayout &DL) { - SmallSet WriteTargets; + SmallPtrSet WriteTargets; // Iterate from the end. for (Instruction *I : reverse(Local)) { if (StoreInst *Store = dyn_cast(I)) { Index: llvm/trunk/lib/Transforms/Scalar/LoopLoadElimination.cpp =================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopLoadElimination.cpp +++ llvm/trunk/lib/Transforms/Scalar/LoopLoadElimination.cpp @@ -25,7 +25,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" @@ -179,7 +179,7 @@ // forward and backward dependences qualify. Disqualify loads that have // other unknown dependences. - SmallSet LoadsWithUnknownDepedence; + SmallPtrSet LoadsWithUnknownDepedence; for (const auto &Dep : *Deps) { Instruction *Source = Dep.getSource(LAI); @@ -302,7 +302,7 @@ /// We need a check if one is a pointer for a candidate load and the other is /// a pointer for a possibly intervening store. bool needsChecking(unsigned PtrIdx1, unsigned PtrIdx2, - const SmallSet &PtrsWrittenOnFwdingPath, + const SmallPtrSet &PtrsWrittenOnFwdingPath, const std::set &CandLoadPtrs) { Value *Ptr1 = LAI.getRuntimePointerChecking()->getPointerInfo(PtrIdx1).PointerValue; @@ -316,7 +316,7 @@ /// forwarding store to a load. /// /// These pointers need to be alias-checked against the forwarding candidates. - SmallSet findPointersWrittenOnForwardingPath( + SmallPtrSet findPointersWrittenOnForwardingPath( const SmallVectorImpl &Candidates) { // From FirstStore to LastLoad neither of the elimination candidate loads // should overlap with any of the stores. @@ -354,7 +354,7 @@ // We're looking for stores after the first forwarding store until the end // of the loop, then from the beginning of the loop until the last // forwarded-to load. Collect the pointer for the stores. - SmallSet PtrsWrittenOnFwdingPath; + SmallPtrSet PtrsWrittenOnFwdingPath; auto InsertStorePtr = [&](Instruction *I) { if (auto *S = dyn_cast(I)) @@ -374,11 +374,11 @@ SmallVector collectMemchecks( const SmallVectorImpl &Candidates) { - SmallSet PtrsWrittenOnFwdingPath = + SmallPtrSet PtrsWrittenOnFwdingPath = findPointersWrittenOnForwardingPath(Candidates); // Collect the pointers of the candidate loads. - // FIXME: SmallSet does not work with std::inserter. + // FIXME: SmallPtrSet does not work with std::inserter. std::set CandLoadPtrs; transform(Candidates, std::inserter(CandLoadPtrs, CandLoadPtrs.begin()), Index: llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp =================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp +++ llvm/trunk/lib/Transforms/Scalar/LoopRerollPass.cpp @@ -17,7 +17,7 @@ #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/MapVector.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" Index: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp =================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp +++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -28,7 +28,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AssumptionCache.h" @@ -1042,7 +1042,7 @@ // until it finds the trivial condition candidate (condition that is not a // constant). Since unswitching generates branches with constant conditions, // this scenario could be very common in practice. - SmallSet Visited; + SmallPtrSet Visited; while (true) { // If we exit loop or reach a previous visited block, then Index: llvm/trunk/lib/Transforms/Scalar/SpeculativeExecution.cpp =================================================================== --- llvm/trunk/lib/Transforms/Scalar/SpeculativeExecution.cpp +++ llvm/trunk/lib/Transforms/Scalar/SpeculativeExecution.cpp @@ -62,7 +62,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Scalar/SpeculativeExecution.h" -#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/Analysis/GlobalsModRef.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/Instructions.h" @@ -252,7 +252,7 @@ bool SpeculativeExecutionPass::considerHoistingFromTo( BasicBlock &FromBlock, BasicBlock &ToBlock) { - SmallSet NotHoisted; + SmallPtrSet NotHoisted; const auto AllPrecedingUsesFromBlockHoisted = [&NotHoisted](User *U) { for (Value* V : U->operand_values()) { if (Instruction *I = dyn_cast(V)) { Index: llvm/trunk/lib/Transforms/Utils/FunctionComparator.cpp =================================================================== --- llvm/trunk/lib/Transforms/Utils/FunctionComparator.cpp +++ llvm/trunk/lib/Transforms/Utils/FunctionComparator.cpp @@ -18,7 +18,6 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Hashing.h" #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/BasicBlock.h" @@ -925,7 +924,7 @@ H.add(F.arg_size()); SmallVector BBs; - SmallSet VisitedBBs; + SmallPtrSet VisitedBBs; // Walk the blocks in the same order as FunctionComparator::cmpBasicBlocks(), // accumulating the hash of the function "structure." (BB and opcode sequence) Index: llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp =================================================================== --- llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp +++ llvm/trunk/lib/Transforms/Utils/LoopUnrollRuntime.cpp @@ -21,7 +21,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/LoopIterator.h" @@ -765,7 +765,7 @@ // values from the cloned region. Also update the dominator info for // OtherExits and their immediate successors, since we have new edges into // OtherExits. - SmallSet ImmediateSuccessorsOfExitBlocks; + SmallPtrSet ImmediateSuccessorsOfExitBlocks; for (auto *BB : OtherExits) { for (auto &II : *BB) { Index: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp =================================================================== --- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp +++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp @@ -19,7 +19,6 @@ #include "llvm/ADT/SetOperations.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringRef.h" Index: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp =================================================================== --- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp +++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -69,7 +69,6 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringRef.h" @@ -5306,7 +5305,7 @@ // Marks the end of each interval. IntervalMap EndPoint; // Saves the list of instruction indices that are used in the loop. - SmallSet Ends; + SmallPtrSet Ends; // Saves the list of values that are used in the loop but are // defined outside the loop, such as arguments and constants. SmallPtrSet LoopInvariants; Index: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp =================================================================== --- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -2615,7 +2615,7 @@ Cost += C; } - SmallSet ExtractCostCalculated; + SmallPtrSet ExtractCostCalculated; int ExtractCost = 0; for (ExternalUser &EU : ExternalUses) { // We only add extract cost once for the same scalar. @@ -3132,7 +3132,7 @@ // PHINodes may have multiple entries from the same block. We want to // visit every block once. - SmallSet VisitedBBs; + SmallPtrSet VisitedBBs; for (unsigned i = 0, e = PH->getNumIncomingValues(); i < e; ++i) { ValueList Operands; @@ -6071,7 +6071,7 @@ // Interrupt the process if the Root instruction itself was vectorized or all // sub-trees not higher that RecursionMaxDepth were analyzed/vectorized. SmallVector, 8> Stack(1, {Root, 0}); - SmallSet VisitedInstrs; + SmallPtrSet VisitedInstrs; bool Res = false; while (!Stack.empty()) { Value *V; @@ -6212,7 +6212,7 @@ bool SLPVectorizerPass::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) { bool Changed = false; SmallVector Incoming; - SmallSet VisitedInstrs; + SmallPtrSet VisitedInstrs; bool HaveVectorizedPhiNodes = true; while (HaveVectorizedPhiNodes) { Index: llvm/trunk/lib/Transforms/Vectorize/VPlan.h =================================================================== --- llvm/trunk/lib/Transforms/Vectorize/VPlan.h +++ llvm/trunk/lib/Transforms/Vectorize/VPlan.h @@ -30,6 +30,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/Optional.h" +#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Twine.h"