diff options
author | Devang Patel <dpatel@apple.com> | 2007-06-21 17:23:45 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-06-21 17:23:45 +0000 |
commit | d5258a23a542812f93d773811fe0e5adafef887f (patch) | |
tree | 51cc70cb1a92508473bd5903b4fd1ec8a4a40da8 /llvm/lib/Transforms/Utils/CodeExtractor.cpp | |
parent | 8e8d34b220378cbcbbd5ced1df1cf74937457eb6 (diff) | |
download | bcm5719-llvm-d5258a23a542812f93d773811fe0e5adafef887f.tar.gz bcm5719-llvm-d5258a23a542812f93d773811fe0e5adafef887f.zip |
Move code to update dominator information after basic block is split
from LoopSimplify.cpp to Dominator.cpp
llvm-svn: 37689
Diffstat (limited to 'llvm/lib/Transforms/Utils/CodeExtractor.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CodeExtractor.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp index c3f24a1e324..aaf99866b11 100644 --- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp +++ b/llvm/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. |