Index: lib/Transforms/Scalar/GVNSink.cpp =================================================================== --- lib/Transforms/Scalar/GVNSink.cpp +++ lib/Transforms/Scalar/GVNSink.cpp @@ -118,7 +118,7 @@ /// list returned by operator*. class LockstepReverseIterator { ArrayRef Blocks; - SmallPtrSet ActiveBlocks; + SmallSetVector ActiveBlocks; SmallVector Insts; bool Fail; @@ -136,7 +136,7 @@ for (BasicBlock *BB : Blocks) { if (BB->size() <= 1) { // Block wasn't big enough - only contained a terminator. - ActiveBlocks.erase(BB); + ActiveBlocks.remove(BB); continue; } Insts.push_back(BB->getTerminator()->getPrevNode()); @@ -147,13 +147,13 @@ bool isValid() const { return !Fail; } ArrayRef operator*() const { return Insts; } - SmallPtrSet &getActiveBlocks() { return ActiveBlocks; } + SmallSetVector &getActiveBlocks() { return ActiveBlocks; } - void restrictToBlocks(SmallPtrSetImpl &Blocks) { + void restrictToBlocks(SmallSetVector &Blocks) { for (auto II = Insts.begin(); II != Insts.end();) { if (std::find(Blocks.begin(), Blocks.end(), (*II)->getParent()) == Blocks.end()) { - ActiveBlocks.erase((*II)->getParent()); + ActiveBlocks.remove((*II)->getParent()); II = Insts.erase(II); } else { ++II; @@ -167,7 +167,7 @@ SmallVector NewInsts; for (auto *Inst : Insts) { if (Inst == &Inst->getParent()->front()) - ActiveBlocks.erase(Inst->getParent()); + ActiveBlocks.remove(Inst->getParent()); else NewInsts.push_back(Inst->getPrevNode()); } @@ -265,7 +265,7 @@ /// Restrict the PHI's contents down to only \c NewBlocks. /// \c NewBlocks must be a subset of \c this->Blocks. - void restrictToBlocks(const SmallPtrSetImpl &NewBlocks) { + void restrictToBlocks(const SmallSetVector &NewBlocks) { auto BI = Blocks.begin(); auto VI = Values.begin(); while (BI != Blocks.end()) { @@ -658,7 +658,7 @@ SmallVector NewInsts; for (auto *I : Insts) { if (VN.lookup(I) != VNumToSink) - ActivePreds.erase(I->getParent()); + ActivePreds.remove(I->getParent()); else NewInsts.push_back(I); }