LSR wants to split the landing pad's critical edge. Let it do it, but use the

proper function to do it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138550 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2011-08-25 05:55:40 +00:00
parent 2df9f8df95
commit 8b6af8a2a9
2 changed files with 37 additions and 1 deletions

View File

@@ -3625,7 +3625,14 @@ void LSRInstance::RewriteForPHI(PHINode *PN,
Loop *PNLoop = LI.getLoopFor(Parent);
if (!PNLoop || Parent != PNLoop->getHeader()) {
// Split the critical edge.
BasicBlock *NewBB = SplitCriticalEdge(BB, Parent, P);
BasicBlock *NewBB = 0;
if (!Parent->isLandingPad()) {
NewBB = SplitCriticalEdge(BB, Parent, P);
} else {
SmallVector<BasicBlock*, 2> NewBBs;
SplitLandingPadPredecessors(Parent, BB, "", "", P, NewBBs);
NewBB = NewBBs[0];
}
// If PN is outside of the loop and BB is in the loop, we want to
// move the block to be immediately before the PHI block, not