diff options
author | Devang Patel <dpatel@apple.com> | 2007-08-02 15:25:57 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-08-02 15:25:57 +0000 |
commit | a882328e61f928e069a005218c0a967e8a10da7a (patch) | |
tree | e6a4b27b625fb5aa0d8ebda4a2bd37cdc201347d /llvm/lib/VMCore/Dominators.cpp | |
parent | fa3eeeedc0a12db20888bd70ff3deea29d1cca81 (diff) | |
download | bcm5719-llvm-a882328e61f928e069a005218c0a967e8a10da7a.tar.gz bcm5719-llvm-a882328e61f928e069a005218c0a967e8a10da7a.zip |
Update dominator info for the middle blocks created while spliting
exit edge to preserve LCSSA.
Fix dominance frontier update during loop unswitch. This fixes PR 1589, again
llvm-svn: 40737
Diffstat (limited to 'llvm/lib/VMCore/Dominators.cpp')
-rw-r--r-- | llvm/lib/VMCore/Dominators.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Dominators.cpp b/llvm/lib/VMCore/Dominators.cpp index 9b5ee1bb40c..91b422c7044 100644 --- a/llvm/lib/VMCore/Dominators.cpp +++ b/llvm/lib/VMCore/Dominators.cpp @@ -627,6 +627,15 @@ void DominanceFrontier::splitBlock(BasicBlock *NewBB) { if (!DT.dominates(NewBB, NewBBSucc)) NewBBDominatesNewBBSucc = false; + // NewBBSucc inherites original NewBB frontier. + DominanceFrontier::iterator NewBBI = find(NewBB); + if (NewBBI != end()) { + DominanceFrontier::DomSetType NewBBSet = NewBBI->second; + DominanceFrontier::DomSetType NewBBSuccSet; + NewBBSuccSet.insert(NewBBSet.begin(), NewBBSet.end()); + addBasicBlock(NewBBSucc, NewBBSuccSet); + } + // If NewBB dominates NewBBSucc, then DF(NewBB) is now going to be the // DF(PredBlocks[0]) without the stuff that the new block does not dominate // a predecessor of. @@ -648,7 +657,6 @@ void DominanceFrontier::splitBlock(BasicBlock *NewBB) { ++SetI; } - DominanceFrontier::iterator NewBBI = find(NewBB); if (NewBBI != end()) { DominanceFrontier::DomSetType NewBBSet = NewBBI->second; NewBBSet.insert(Set.begin(), Set.end()); |