diff options
| author | Craig Topper <craig.topper@intel.com> | 2018-06-09 05:04:20 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2018-06-09 05:04:20 +0000 |
| commit | 61998289f93772f354a29417ce76323b13bd4736 (patch) | |
| tree | e4b2fd98361395bac762d80a575151f1e044fb91 /llvm/lib | |
| parent | ea62c5bbde084900f9ff6fc28afb9059936f2559 (diff) | |
| download | bcm5719-llvm-61998289f93772f354a29417ce76323b13bd4736.tar.gz bcm5719-llvm-61998289f93772f354a29417ce76323b13bd4736.zip | |
Use SmallPtrSet instead of SmallSet in places where we iterate over the set.
SmallSet forwards to SmallPtrSet for pointer types. SmallPtrSet supports iteration, but a normal SmallSet doesn't. So if it wasn't for the forwarding, this wouldn't work.
These places were found by hiding the begin/end methods in the SmallSet forwarding
llvm-svn: 334343
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopRerollPass.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/VPlan.h | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 00ce421e6c6..77e5cdd8f8e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -5357,7 +5357,7 @@ SDValue DAGCombiner::MatchLoadCombine(SDNode *N) { Optional<BaseIndexOffset> Base; SDValue Chain; - SmallSet<LoadSDNode *, 8> Loads; + SmallPtrSet<LoadSDNode *, 8> Loads; Optional<ByteProvider> FirstByteProvider; int64_t FirstOffset = INT64_MAX; diff --git a/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp b/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp index 6cf37d52683..d4de25ac774 100644 --- a/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp +++ b/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp @@ -189,7 +189,7 @@ namespace { bool PreserveLCSSA; using SmallInstructionVector = SmallVector<Instruction *, 16>; - using SmallInstructionSet = SmallSet<Instruction *, 16>; + using SmallInstructionSet = SmallPtrSet<Instruction *, 16>; // Map between induction variable and its increment DenseMap<Instruction *, int64_t> IVToIncMap; diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index d362c0f9a5a..c99c2a92a60 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -5710,7 +5710,7 @@ static bool TryToMergeLandingPad(LandingPadInst *LPad, BranchInst *BI, // We've found an identical block. Update our predecessors to take that // path instead and make ourselves dead. - SmallSet<BasicBlock *, 16> Preds; + SmallPtrSet<BasicBlock *, 16> Preds; Preds.insert(pred_begin(BB), pred_end(BB)); for (BasicBlock *Pred : Preds) { InvokeInst *II = cast<InvokeInst>(Pred->getTerminator()); @@ -5728,7 +5728,7 @@ static bool TryToMergeLandingPad(LandingPadInst *LPad, BranchInst *BI, Inst.eraseFromParent(); } - SmallSet<BasicBlock *, 16> Succs; + SmallPtrSet<BasicBlock *, 16> Succs; Succs.insert(succ_begin(BB), succ_end(BB)); for (BasicBlock *Succ : Succs) { Succ->removePredecessor(BB); diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index b0890dfccde..df233e6a1ff 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -958,7 +958,7 @@ public: : PSE(PSE), TheLoop(L), DT(DT), LI(LI), LAI(LAI) {} ~InterleavedAccessInfo() { - SmallSet<InterleaveGroup *, 4> DelSet; + SmallPtrSet<InterleaveGroup *, 4> DelSet; // Avoid releasing a pointer twice. for (auto &I : InterleaveGroupMap) DelSet.insert(I.second); @@ -5345,7 +5345,7 @@ LoopVectorizationCostModel::calculateRegisterUsage(ArrayRef<unsigned> VFs) { for (auto &Interval : EndPoint) TransposeEnds[Interval.second].push_back(Interval.first); - SmallSet<Instruction *, 8> OpenIntervals; + SmallPtrSet<Instruction *, 8> OpenIntervals; // Get the size of the widest register. unsigned MaxSafeDepDist = -1U; diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h index b9a82d4d61b..9f7bd5d8ea7 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.h +++ b/llvm/lib/Transforms/Vectorize/VPlan.h @@ -1053,7 +1053,7 @@ private: // VPlan. External definitions must be immutable and hold a pointer to its // underlying IR that will be used to implement its structural comparison // (operators '==' and '<'). - SmallSet<VPValue *, 16> VPExternalDefs; + SmallPtrSet<VPValue *, 16> VPExternalDefs; /// Holds a mapping between Values and their corresponding VPValue inside /// VPlan. |

