LSR should avoid redundant edge splitting.
[oota-llvm.git] / lib / Transforms / Scalar / LoopStrengthReduce.cpp
index 7b1a340156d172bc66061df7571e089b7669b466..4b6c55e1627f1e2ec996f66de1cea7b9acc90000 100644 (file)
@@ -3677,7 +3677,9 @@ void LSRInstance::RewriteForPHI(PHINode *PN,
           // Split the critical edge.
           BasicBlock *NewBB = 0;
           if (!Parent->isLandingPad()) {
-            NewBB = SplitCriticalEdge(BB, Parent, P);
+            NewBB = SplitCriticalEdge(BB, Parent, P,
+                                      /*MergeIdenticalEdges=*/true,
+                                      /*DontDeleteUselessPhis=*/true);
           } else {
             SmallVector<BasicBlock*, 2> NewBBs;
             SplitLandingPadPredecessors(Parent, BB, "", "", P, NewBBs);