aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-08-02 15:25:57 +0000
committerDevang Patel <dpatel@apple.com>2007-08-02 15:25:57 +0000
commit1ff61385c8feb655a1e70cc67999680cc93f0f67 (patch)
tree41a2ddac459199e29d248eae858c8bbb7748b57a /lib/VMCore
parent73a902b2281398c187b134e7a17e6b1e394166be (diff)
downloadexternal_llvm-1ff61385c8feb655a1e70cc67999680cc93f0f67.zip
external_llvm-1ff61385c8feb655a1e70cc67999680cc93f0f67.tar.gz
external_llvm-1ff61385c8feb655a1e70cc67999680cc93f0f67.tar.bz2
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Dominators.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/VMCore/Dominators.cpp b/lib/VMCore/Dominators.cpp
index 9b5ee1b..91b422c 100644
--- a/lib/VMCore/Dominators.cpp
+++ b/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());