1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Simplify use of DFBlocks, this makes no noticable performance difference,

but paves the way to eliminate BBNumbers.

llvm-svn: 33938
This commit is contained in:
Chris Lattner 2007-02-05 23:31:26 +00:00
parent b509040034
commit 7703e811eb

View File

@ -272,7 +272,7 @@ void PromoteMem2Reg::run() {
//
unsigned CurrentVersion = 0;
SmallPtrSet<PHINode*, 16> InsertedPHINodes;
std::vector<unsigned> DFBlocks;
std::vector<std::pair<unsigned, BasicBlock*> > DFBlocks;
while (!DefiningBlocks.empty()) {
BasicBlock *BB = DefiningBlocks.back();
DefiningBlocks.pop_back();
@ -289,13 +289,13 @@ void PromoteMem2Reg::run() {
// processing blocks in order of the occurance in the function.
for (DominanceFrontier::DomSetType::const_iterator P = S.begin(),
PE = S.end(); P != PE; ++P)
DFBlocks.push_back(BBNumbers.getNumber(*P));
DFBlocks.push_back(std::make_pair(BBNumbers.getNumber(*P), *P));
// Sort by which the block ordering in the function.
std::sort(DFBlocks.begin(), DFBlocks.end());
for (unsigned i = 0, e = DFBlocks.size(); i != e; ++i) {
BasicBlock *BB = BBNumbers.getBlock(DFBlocks[i]);
BasicBlock *BB = DFBlocks[i].second;
if (QueuePhiNode(BB, AllocaNum, CurrentVersion, InsertedPHINodes))
DefiningBlocks.push_back(BB);
}