diff options
| author | Andrew Trick <atrick@apple.com> | 2011-10-04 03:50:44 +0000 |
|---|---|---|
| committer | Andrew Trick <atrick@apple.com> | 2011-10-04 03:50:44 +0000 |
| commit | 8de329a9fc6100f4a8db6b86c76fad624446995e (patch) | |
| tree | 95a5b140cb204f40065fc903a1e67018e7332f91 /llvm/lib/Transforms/Utils | |
| parent | 411842f98f392c2974db6d8921dd1d6c48d95b5f (diff) | |
| download | bcm5719-llvm-8de329a9fc6100f4a8db6b86c76fad624446995e.tar.gz bcm5719-llvm-8de329a9fc6100f4a8db6b86c76fad624446995e.zip | |
LSR should avoid redundant edge splitting.
This handles the case in which LSR rewrites an IV user that is a phi and
splits critical edges originating from a switch.
Fixes <rdar://problem/6453893> LSR is not splitting edges "nicely"
llvm-svn: 141059
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp index 4648f496450..c0529108815 100644 --- a/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp +++ b/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp @@ -167,7 +167,8 @@ static void CreatePHIsForSplitLoopExit(SmallVectorImpl<BasicBlock *> &Preds, /// to. /// BasicBlock *llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, - Pass *P, bool MergeIdenticalEdges) { + Pass *P, bool MergeIdenticalEdges, + bool DontDeleteUselessPhis) { if (!isCriticalEdge(TI, SuccNum, MergeIdenticalEdges)) return 0; assert(!isa<IndirectBrInst>(TI) && @@ -224,7 +225,7 @@ BasicBlock *llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, if (TI->getSuccessor(i) != DestBB) continue; // Remove an entry for TIBB from DestBB phi nodes. - DestBB->removePredecessor(TIBB); + DestBB->removePredecessor(TIBB, DontDeleteUselessPhis); // We found another edge to DestBB, go to NewBB instead. TI->setSuccessor(i, NewBB); |

