mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
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:
parent
7ef856dfad
commit
6a1a28dedd
@ -115,7 +115,7 @@ namespace {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void MarkDominatingPHILive(BasicBlock *BB, unsigned AllocaNum,
|
void MarkDominatingPHILive(BasicBlock *BB, unsigned AllocaNum,
|
||||||
std::set<PHINode*> &DeadPHINodes);
|
SmallPtrSet<PHINode*, 16> &DeadPHINodes);
|
||||||
bool PromoteLocallyUsedAlloca(BasicBlock *BB, AllocaInst *AI);
|
bool PromoteLocallyUsedAlloca(BasicBlock *BB, AllocaInst *AI);
|
||||||
void PromoteLocallyUsedAllocas(BasicBlock *BB,
|
void PromoteLocallyUsedAllocas(BasicBlock *BB,
|
||||||
const std::vector<AllocaInst*> &AIs);
|
const std::vector<AllocaInst*> &AIs);
|
||||||
@ -123,7 +123,7 @@ namespace {
|
|||||||
void RenamePass(BasicBlock *BB, BasicBlock *Pred,
|
void RenamePass(BasicBlock *BB, BasicBlock *Pred,
|
||||||
std::vector<Value*> &IncVals);
|
std::vector<Value*> &IncVals);
|
||||||
bool QueuePhiNode(BasicBlock *BB, unsigned AllocaIdx, unsigned &Version,
|
bool QueuePhiNode(BasicBlock *BB, unsigned AllocaIdx, unsigned &Version,
|
||||||
std::set<PHINode*> &InsertedPHINodes);
|
SmallPtrSet<PHINode*, 16> &InsertedPHINodes);
|
||||||
};
|
};
|
||||||
} // end of anonymous namespace
|
} // end of anonymous namespace
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ void PromoteMem2Reg::run() {
|
|||||||
// dominance frontier of EACH basic-block we have a write in.
|
// dominance frontier of EACH basic-block we have a write in.
|
||||||
//
|
//
|
||||||
unsigned CurrentVersion = 0;
|
unsigned CurrentVersion = 0;
|
||||||
std::set<PHINode*> InsertedPHINodes;
|
SmallPtrSet<PHINode*, 16> InsertedPHINodes;
|
||||||
std::vector<unsigned> DFBlocks;
|
std::vector<unsigned> DFBlocks;
|
||||||
while (!DefiningBlocks.empty()) {
|
while (!DefiningBlocks.empty()) {
|
||||||
BasicBlock *BB = DefiningBlocks.back();
|
BasicBlock *BB = DefiningBlocks.back();
|
||||||
@ -315,7 +315,7 @@ void PromoteMem2Reg::run() {
|
|||||||
UsingBlocks.clear();
|
UsingBlocks.clear();
|
||||||
|
|
||||||
// If there are any PHI nodes which are now known to be dead, remove them!
|
// 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) {
|
E = InsertedPHINodes.end(); I != E; ++I) {
|
||||||
PHINode *PN = *I;
|
PHINode *PN = *I;
|
||||||
std::vector<PHINode*> &BBPNs = NewPhiNodes[PN->getParent()];
|
std::vector<PHINode*> &BBPNs = NewPhiNodes[PN->getParent()];
|
||||||
@ -489,7 +489,7 @@ void PromoteMem2Reg::run() {
|
|||||||
// DeadPHINodes set are removed.
|
// DeadPHINodes set are removed.
|
||||||
//
|
//
|
||||||
void PromoteMem2Reg::MarkDominatingPHILive(BasicBlock *BB, unsigned AllocaNum,
|
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
|
// 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!
|
// 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()) {
|
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,
|
bool PromoteMem2Reg::QueuePhiNode(BasicBlock *BB, unsigned AllocaNo,
|
||||||
unsigned &Version,
|
unsigned &Version,
|
||||||
std::set<PHINode*> &InsertedPHINodes) {
|
SmallPtrSet<PHINode*, 16> &InsertedPHINodes) {
|
||||||
// Look up the basic-block in question.
|
// Look up the basic-block in question.
|
||||||
std::vector<PHINode*> &BBPNs = NewPhiNodes[BB];
|
std::vector<PHINode*> &BBPNs = NewPhiNodes[BB];
|
||||||
if (BBPNs.empty()) BBPNs.resize(Allocas.size());
|
if (BBPNs.empty()) BBPNs.resize(Allocas.size());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user