Author: dpatel
Date: Mon Aug 13 16:59:17 2007
New Revision: 41051

URL: http://llvm.org/viewvc/llvm-project?rev=41051&view=rev
Log:
If NewBB dominates DestBB then DestBB is not part of NewBB's dominance frontier.

Modified:
    llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp

Modified: llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp?rev=41051&r1=41050&r2=41051&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/BreakCriticalEdges.cpp Mon Aug 13 16:59:17 
2007
@@ -227,8 +227,12 @@
     DominanceFrontier::DomSetType NewDFSet;
     if (NewBBDominatesDestBB) {
       DominanceFrontier::iterator I = DF->find(DestBB);
-      if (I != DF->end())
+      if (I != DF->end()) {
         DF->addBasicBlock(NewBB, I->second);
+        // However NewBB's frontier does not include DestBB.
+        DominanceFrontier::iterator NF = DF->find(NewBB);
+        DF->removeFromFrontier(NF, DestBB);
+      }
       else
         DF->addBasicBlock(NewBB, DominanceFrontier::DomSetType());
     } else {


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to