1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

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
This commit is contained in:
Craig Topper 2018-06-09 05:04:20 +00:00
parent 1799831af2
commit 3e90558514
5 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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.