From 0ac904455e15edb67403e278c1e913f41f896e5c Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 21 May 2009 20:40:30 +0000 Subject: Fix some incorrect logic in DominanceFrontier::splitBlock. Part of PR4238. llvm-svn: 72223 --- llvm/lib/VMCore/Dominators.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'llvm/lib/VMCore/Dominators.cpp') diff --git a/llvm/lib/VMCore/Dominators.cpp b/llvm/lib/VMCore/Dominators.cpp index 6f1de466043..735a70c5092 100644 --- a/llvm/lib/VMCore/Dominators.cpp +++ b/llvm/lib/VMCore/Dominators.cpp @@ -160,10 +160,7 @@ void DominanceFrontier::splitBlock(BasicBlock *NewBB) { break; } } - - if (!BlockDominatesAny) - continue; - + // If NewBBSucc should not stay in our dominator frontier, remove it. // We remove it unless there is a predecessor of NewBBSucc that we // dominate, but we don't strictly dominate NewBBSucc. @@ -181,7 +178,8 @@ void DominanceFrontier::splitBlock(BasicBlock *NewBB) { if (ShouldRemove) removeFromFrontier(DFI, NewBBSucc); - addToFrontier(DFI, NewBB); + if (BlockDominatesAny && (&*FI == NewBB || !DT.dominates(FI, NewBB))) + addToFrontier(DFI, NewBB); } } -- cgit v1.2.3