Index: include/llvm/Analysis/IteratedDominanceFrontier.h =================================================================== --- include/llvm/Analysis/IteratedDominanceFrontier.h +++ include/llvm/Analysis/IteratedDominanceFrontier.h @@ -25,6 +25,7 @@ #define LLVM_ANALYSIS_IDF_H #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/IR/BasicBlock.h" @@ -53,7 +54,7 @@ /// calculating the IDF for (though later gets pruned based on liveness). /// /// Note: This set *must* live for the entire lifetime of the IDF calculator. - void setDefiningBlocks(const SmallPtrSetImpl &Blocks) { + void setDefiningBlocks(const SmallSetVector &Blocks) { DefBlocks = &Blocks; } @@ -88,7 +89,7 @@ bool useLiveIn; DenseMap DomLevels; const SmallPtrSetImpl *LiveInBlocks; - const SmallPtrSetImpl *DefBlocks; + const SmallSetVector *DefBlocks; }; typedef IDFCalculator ForwardIDFCalculator; typedef IDFCalculator> ReverseIDFCalculator; Index: include/llvm/Transforms/Utils/MemorySSA.h =================================================================== --- include/llvm/Transforms/Utils/MemorySSA.h +++ include/llvm/Transforms/Utils/MemorySSA.h @@ -74,6 +74,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/GraphTraits.h" +#include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/ilist.h" @@ -629,7 +630,7 @@ MemoryAccess *findDominatingDef(BasicBlock *, enum InsertionPlace); void removeFromLookups(MemoryAccess *); - void placePHINodes(const SmallPtrSetImpl &); + void placePHINodes(const SmallSetVector &); MemoryAccess *renameBlock(BasicBlock *, MemoryAccess *); void renamePass(DomTreeNode *, MemoryAccess *IncomingVal, SmallPtrSet &Visited); Index: lib/Transforms/Scalar/ADCE.cpp =================================================================== --- lib/Transforms/Scalar/ADCE.cpp +++ lib/Transforms/Scalar/ADCE.cpp @@ -17,6 +17,7 @@ #include "llvm/Transforms/Scalar/ADCE.h" #include "llvm/ADT/DepthFirstIterator.h" +#include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" @@ -99,7 +100,7 @@ /// The set of blocks which we have determined are live in the /// most recent iteration of propagating liveness. - SmallPtrSet NewLiveBlocks; + SmallSetVector NewLiveBlocks; /// Set up auxiliary data structures for Instructions and BasicBlocks and /// initialize the Worklist to the set of must-be-live Instruscions. Index: lib/Transforms/Utils/MemorySSA.cpp =================================================================== --- lib/Transforms/Utils/MemorySSA.cpp +++ lib/Transforms/Utils/MemorySSA.cpp @@ -17,6 +17,7 @@ #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/PostOrderIterator.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallBitVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallSet.h" @@ -1463,7 +1464,7 @@ } void MemorySSA::placePHINodes( - const SmallPtrSetImpl &DefiningBlocks) { + const SmallSetVector &DefiningBlocks) { // Determine where our MemoryPhi's should go ForwardIDFCalculator IDFs(*DT); IDFs.setDefiningBlocks(DefiningBlocks); @@ -1495,8 +1496,8 @@ // We maintain lists of memory accesses per-block, trading memory for time. We // could just look up the memory access for every possible instruction in the // stream. - SmallPtrSet DefiningBlocks; - SmallPtrSet DefUseBlocks; + SmallSetVector DefiningBlocks; + SmallSetVector DefUseBlocks; // Go through each block, figure out where defs occur, and chain together all // the accesses. for (BasicBlock &B : F) { Index: lib/Transforms/Utils/PromoteMemoryToRegister.cpp =================================================================== --- lib/Transforms/Utils/PromoteMemoryToRegister.cpp +++ lib/Transforms/Utils/PromoteMemoryToRegister.cpp @@ -19,6 +19,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" @@ -291,7 +292,7 @@ } void ComputeLiveInBlocks(AllocaInst *AI, AllocaInfo &Info, - const SmallPtrSetImpl &DefBlocks, + const SmallSetVector &DefBlocks, SmallPtrSetImpl &LiveInBlocks); void RenamePass(BasicBlock *BB, BasicBlock *Pred, RenamePassData::ValVector &IncVals, @@ -597,7 +598,7 @@ // Unique the set of defining blocks for efficient lookup. - SmallPtrSet DefBlocks; + SmallSetVector DefBlocks; DefBlocks.insert(Info.DefiningBlocks.begin(), Info.DefiningBlocks.end()); // Determine which blocks the value is live in. These are blocks which lead @@ -774,7 +775,7 @@ /// inserted phi nodes would be dead). void PromoteMem2Reg::ComputeLiveInBlocks( AllocaInst *AI, AllocaInfo &Info, - const SmallPtrSetImpl &DefBlocks, + const SmallSetVector &DefBlocks, SmallPtrSetImpl &LiveInBlocks) { // To determine liveness, we must iterate through the predecessors of blocks