From: Owen Anderson Date: Tue, 3 Jun 2008 18:29:48 +0000 (+0000) Subject: LoopIndexSplit can sometimes result in cases where a block in its own domfrontier. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=269db29bdbd5d3264a859e7d3763a4c501fb9ee4;p=oota-llvm.git LoopIndexSplit can sometimes result in cases where a block in its own domfrontier. Don't crash when we encounter one of these. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51915 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp index bc9fdfde88b..a821423d17f 100644 --- a/lib/Transforms/Utils/BreakCriticalEdges.cpp +++ b/lib/Transforms/Utils/BreakCriticalEdges.cpp @@ -235,9 +235,12 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P, DominanceFrontier::iterator I = DF->find(DestBB); if (I != DF->end()) { DF->addBasicBlock(NewBB, I->second); - // However NewBB's frontier does not include DestBB. - DominanceFrontier::iterator NF = DF->find(NewBB); - DF->removeFromFrontier(NF, DestBB); + + if (I->second.count(DestBB)) { + // However NewBB's frontier does not include DestBB. + DominanceFrontier::iterator NF = DF->find(NewBB); + DF->removeFromFrontier(NF, DestBB); + } } else DF->addBasicBlock(NewBB, DominanceFrontier::DomSetType());