From 0e7f728ad1ac25b0ed450fe0f8b86a38d3c2a93a Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 21 Jun 2007 17:23:45 +0000 Subject: Move code to update dominator information after basic block is split from LoopSimplify.cpp to Dominator.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37689 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/CodeExtractor.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'lib/Transforms/Utils/CodeExtractor.cpp') diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp index c3f24a1e32..aaf99866b1 100644 --- a/lib/Transforms/Utils/CodeExtractor.cpp +++ b/lib/Transforms/Utils/CodeExtractor.cpp @@ -140,19 +140,8 @@ void CodeExtractor::severSplitPHINodes(BasicBlock *&Header) { // Okay, update dominator sets. The blocks that dominate the new one are the // blocks that dominate TIBB plus the new block itself. - if (DT) { - DomTreeNode *OPNode = DT->getNode(OldPred); - DomTreeNode *IDomNode = OPNode->getIDom(); - BasicBlock* idom = IDomNode->getBlock(); - DT->addNewBlock(NewBB, idom); - - // Additionally, NewBB replaces OldPred as the immediate dominator of blocks - Function *F = Header->getParent(); - for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) - if (DT->getIDomBlock(I) == OldPred) { - DT->changeImmediateDominator(I, NewBB); - } - } + if (DT) + DT->splitBlock(NewBB); // Okay, now we need to adjust the PHI nodes and any branches from within the // region to go to the new header block instead of the old header block. -- cgit v1.2.3-70-g09d2