Switch InsertedPHINodes back to SmallPtrSet now that the SmallPtrSet::erase

bug is fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33932 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-02-05 23:11:37 +00:00
parent 7ef856dfad
commit 6a1a28dedd

View File

@ -115,7 +115,7 @@ namespace {
private:
void MarkDominatingPHILive(BasicBlock *BB, unsigned AllocaNum,
std::set<PHINode*> &DeadPHINodes);
SmallPtrSet<PHINode*, 16> &DeadPHINodes);
bool PromoteLocallyUsedAlloca(BasicBlock *BB, AllocaInst *AI);
void PromoteLocallyUsedAllocas(BasicBlock *BB,
const std::vector<AllocaInst*> &AIs);
@ -123,7 +123,7 @@ namespace {
void RenamePass(BasicBlock *BB, BasicBlock *Pred,
std::vector<Value*> &IncVals);
bool QueuePhiNode(BasicBlock *BB, unsigned AllocaIdx, unsigned &Version,
std::set<PHINode*> &InsertedPHINodes);
SmallPtrSet<PHINode*, 16> &InsertedPHINodes);
};
} // end of anonymous namespace
@ -271,7 +271,7 @@ void PromoteMem2Reg::run() {
// dominance frontier of EACH basic-block we have a write in.
//
unsigned CurrentVersion = 0;
std::set<PHINode*> InsertedPHINodes;
SmallPtrSet<PHINode*, 16> InsertedPHINodes;
std::vector<unsigned> DFBlocks;
while (!DefiningBlocks.empty()) {
BasicBlock *BB = DefiningBlocks.back();
@ -315,7 +315,7 @@ void PromoteMem2Reg::run() {
UsingBlocks.clear();
// If there are any PHI nodes which are now known to be dead, remove them!
for (std::set<PHINode*>::iterator I = InsertedPHINodes.begin(),
for (SmallPtrSet<PHINode*, 16>::iterator I = InsertedPHINodes.begin(),
E = InsertedPHINodes.end(); I != E; ++I) {
PHINode *PN = *I;
std::vector<PHINode*> &BBPNs = NewPhiNodes[PN->getParent()];
@ -489,7 +489,7 @@ void PromoteMem2Reg::run() {
// DeadPHINodes set are removed.
//
void PromoteMem2Reg::MarkDominatingPHILive(BasicBlock *BB, unsigned AllocaNum,
std::set<PHINode*> &DeadPHINodes) {
SmallPtrSet<PHINode*, 16> &DeadPHINodes) {
// Scan the immediate dominators of this block looking for a block which has a
// PHI node for Alloca num. If we find it, mark the PHI node as being alive!
for (DominatorTree::Node *N = DT[BB]; N; N = N->getIDom()) {
@ -630,7 +630,7 @@ PromoteLocallyUsedAllocas(BasicBlock *BB, const std::vector<AllocaInst*> &AIs) {
//
bool PromoteMem2Reg::QueuePhiNode(BasicBlock *BB, unsigned AllocaNo,
unsigned &Version,
std::set<PHINode*> &InsertedPHINodes) {
SmallPtrSet<PHINode*, 16> &InsertedPHINodes) {
// Look up the basic-block in question.
std::vector<PHINode*> &BBPNs = NewPhiNodes[BB];
if (BBPNs.empty()) BBPNs.resize(Allocas.size());