@@ -910,7 +910,7 @@ bool SimplifyCFGOpt::SimplifyEqualityComparisonWithOnlyPredecessor(
910
910
LLVM_DEBUG (dbgs () << " Threading pred instr: " << *Pred->getTerminator ()
911
911
<< " Through successor TI: " << *TI);
912
912
913
- SmallMapVector <BasicBlock *, int , 8 > NumPerSuccessorCases;
913
+ SmallDenseMap <BasicBlock *, int , 8 > NumPerSuccessorCases;
914
914
for (SwitchInst::CaseIt i = SI->case_end (), e = SI->case_begin (); i != e;) {
915
915
--i;
916
916
auto *Successor = i->getCaseSuccessor ();
@@ -961,7 +961,7 @@ bool SimplifyCFGOpt::SimplifyEqualityComparisonWithOnlyPredecessor(
961
961
if (!TheRealDest)
962
962
TheRealDest = ThisDef;
963
963
964
- SmallSetVector <BasicBlock *, 2 > RemovedSuccs;
964
+ SmallPtrSet <BasicBlock *, 2 > RemovedSuccs;
965
965
966
966
// Remove PHI node entries for dead edges.
967
967
BasicBlock *CheckEdge = TheRealDest;
@@ -3793,7 +3793,7 @@ bool SimplifyCFGOpt::SimplifyTerminatorOnSelect(Instruction *OldTerm,
3793
3793
BasicBlock *KeepEdge1 = TrueBB;
3794
3794
BasicBlock *KeepEdge2 = TrueBB != FalseBB ? FalseBB : nullptr ;
3795
3795
3796
- SmallSetVector <BasicBlock *, 2 > RemovedSuccessors;
3796
+ SmallPtrSet <BasicBlock *, 2 > RemovedSuccessors;
3797
3797
3798
3798
// Then remove the rest.
3799
3799
for (BasicBlock *Succ : successors (OldTerm)) {
@@ -4913,7 +4913,7 @@ static bool eliminateDeadSwitchCases(SwitchInst *SI, DomTreeUpdater *DTU,
4913
4913
4914
4914
// Gather dead cases.
4915
4915
SmallVector<ConstantInt *, 8 > DeadCases;
4916
- SmallMapVector <BasicBlock *, int , 8 > NumPerSuccessorCases;
4916
+ SmallDenseMap <BasicBlock *, int , 8 > NumPerSuccessorCases;
4917
4917
for (auto &Case : SI->cases ()) {
4918
4918
auto *Successor = Case.getCaseSuccessor ();
4919
4919
if (DTU)
@@ -5999,7 +5999,7 @@ static bool SwitchToLookupTable(SwitchInst *SI, IRBuilder<> &Builder,
5999
5999
}
6000
6000
6001
6001
// Remove the switch.
6002
- SmallSetVector <BasicBlock *, 8 > RemovedSuccessors;
6002
+ SmallPtrSet <BasicBlock *, 8 > RemovedSuccessors;
6003
6003
for (unsigned i = 0 , e = SI->getNumSuccessors (); i < e; ++i) {
6004
6004
BasicBlock *Succ = SI->getSuccessor (i);
6005
6005
@@ -6181,7 +6181,7 @@ bool SimplifyCFGOpt::simplifyIndirectBr(IndirectBrInst *IBI) {
6181
6181
6182
6182
// Eliminate redundant destinations.
6183
6183
SmallPtrSet<Value *, 8 > Succs;
6184
- SmallSetVector <BasicBlock *, 8 > RemovedSuccs;
6184
+ SmallPtrSet <BasicBlock *, 8 > RemovedSuccs;
6185
6185
for (unsigned i = 0 , e = IBI->getNumDestinations (); i != e; ++i) {
6186
6186
BasicBlock *Dest = IBI->getDestination (i);
6187
6187
if (!Dest->hasAddressTaken () || !Succs.insert (Dest).second ) {
@@ -6271,8 +6271,7 @@ static bool TryToMergeLandingPad(LandingPadInst *LPad, BranchInst *BI,
6271
6271
6272
6272
// We've found an identical block. Update our predecessors to take that
6273
6273
// path instead and make ourselves dead.
6274
- SmallPtrSet<BasicBlock *, 16 > Preds;
6275
- Preds.insert (pred_begin (BB), pred_end (BB));
6274
+ SmallPtrSet<BasicBlock *, 16 > Preds (pred_begin (BB), pred_end (BB));
6276
6275
for (BasicBlock *Pred : Preds) {
6277
6276
InvokeInst *II = cast<InvokeInst>(Pred->getTerminator ());
6278
6277
assert (II->getNormalDest () != BB && II->getUnwindDest () == BB &&
@@ -6293,8 +6292,7 @@ static bool TryToMergeLandingPad(LandingPadInst *LPad, BranchInst *BI,
6293
6292
Inst.eraseFromParent ();
6294
6293
}
6295
6294
6296
- SmallPtrSet<BasicBlock *, 16 > Succs;
6297
- Succs.insert (succ_begin (BB), succ_end (BB));
6295
+ SmallPtrSet<BasicBlock *, 16 > Succs (succ_begin (BB), succ_end (BB));
6298
6296
for (BasicBlock *Succ : Succs) {
6299
6297
Succ->removePredecessor (BB);
6300
6298
if (DTU)
0 commit comments