From 30f3ebbc1ff284a94b96fd5519e2847a48b2cb1d Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 12 Jan 2011 19:12:45 +0000 Subject: [PATCH] Use SmallVector instead of SmallPtrSet and avoid non-deterministic behavior. llvm-svn: 123318 --- llvm/lib/Transforms/Scalar/LoopDeletion.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp index eddad3e426a5..b60f0c38bbc2 100644 --- a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp +++ b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp @@ -194,13 +194,13 @@ bool LoopDeletion::runOnLoop(Loop* L, LPPassManager& LPM) { // be deleted from the reference counting scheme. DominatorTree& DT = getAnalysis(); DominanceFrontier* DF = getAnalysisIfAvailable(); - SmallPtrSet ChildNodes; + SmallVector ChildNodes; for (Loop::block_iterator LI = L->block_begin(), LE = L->block_end(); LI != LE; ++LI) { // Move all of the block's children to be children of the preheader, which // allows us to remove the domtree entry for the block. - ChildNodes.insert(DT[*LI]->begin(), DT[*LI]->end()); - for (SmallPtrSet::iterator DI = ChildNodes.begin(), + ChildNodes.insert(ChildNodes.begin(), DT[*LI]->begin(), DT[*LI]->end()); + for (SmallVector::iterator DI = ChildNodes.begin(), DE = ChildNodes.end(); DI != DE; ++DI) { DT.changeImmediateDominator(*DI, DT[preheader]); if (DF) DF->changeImmediateDominator((*DI)->getBlock(), preheader, &DT);