From f2407aa98b5269cc8b1e164b19ef8729fff82315 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Tue, 11 Jan 2011 22:54:38 +0000 Subject: [PATCH] Fix a non-deterministic loop in llvm::MergeBlockIntoPredecessor. DT->changeImmediateDominator() trivially ignores identity updates, so there is really no need for the uniqueing provided by SmallPtrSet. I expect this to fix PR8954. llvm-svn: 123286 --- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp index e71e84feac41..c5b970704947 100644 --- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -169,8 +169,8 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock *BB, Pass *P) { if (DominatorTree *DT = P->getAnalysisIfAvailable()) { if (DomTreeNode *DTN = DT->getNode(BB)) { DomTreeNode *PredDTN = DT->getNode(PredBB); - SmallPtrSet Children(DTN->begin(), DTN->end()); - for (SmallPtrSet::iterator DI = Children.begin(), + SmallVector Children(DTN->begin(), DTN->end()); + for (SmallVector::iterator DI = Children.begin(), DE = Children.end(); DI != DE; ++DI) DT->changeImmediateDominator(*DI, PredDTN);