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

Use SmallVector instead of SmallPtrSet and avoid non-deterministic behavior.

llvm-svn: 123318
This commit is contained in:
Devang Patel 2011-01-12 19:12:45 +00:00
parent fc76b0ce6e
commit 52db9b4821

View File

@ -194,13 +194,13 @@ bool LoopDeletion::runOnLoop(Loop* L, LPPassManager& LPM) {
// be deleted from the reference counting scheme. // be deleted from the reference counting scheme.
DominatorTree& DT = getAnalysis<DominatorTree>(); DominatorTree& DT = getAnalysis<DominatorTree>();
DominanceFrontier* DF = getAnalysisIfAvailable<DominanceFrontier>(); DominanceFrontier* DF = getAnalysisIfAvailable<DominanceFrontier>();
SmallPtrSet<DomTreeNode*, 8> ChildNodes; SmallVector<DomTreeNode*, 8> ChildNodes;
for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end(); for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end();
LI != LE; ++LI) { LI != LE; ++LI) {
// Move all of the block's children to be children of the preheader, which // Move all of the block's children to be children of the preheader, which
// allows us to remove the domtree entry for the block. // allows us to remove the domtree entry for the block.
ChildNodes.insert(DT[*LI]->begin(), DT[*LI]->end()); ChildNodes.insert(ChildNodes.begin(), DT[*LI]->begin(), DT[*LI]->end());
for (SmallPtrSet<DomTreeNode*, 8>::iterator DI = ChildNodes.begin(), for (SmallVector<DomTreeNode*, 8>::iterator DI = ChildNodes.begin(),
DE = ChildNodes.end(); DI != DE; ++DI) { DE = ChildNodes.end(); DI != DE; ++DI) {
DT.changeImmediateDominator(*DI, DT[preheader]); DT.changeImmediateDominator(*DI, DT[preheader]);
if (DF) DF->changeImmediateDominator((*DI)->getBlock(), preheader, &DT); if (DF) DF->changeImmediateDominator((*DI)->getBlock(), preheader, &DT);