diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-03-13 22:59:14 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-03-13 22:59:14 +0000 |
commit | fc0b80d9746e5fd4b45057ab814c67371fb0f9ea (patch) | |
tree | 4e1792d9877bf7d0f8cb6090004afe0f8cfc31df /lib/Transforms/Scalar/CodeGenPrepare.cpp | |
parent | 557f7f88ba686886278f83159b7a629c24a47176 (diff) |
Fix PR3784: If the source of a phi comes from a bb ended with an invoke, make sure the copy is inserted before the try range (unless it's used as an input to the invoke, then insert it after the last use), not at the end of the bb.
Also re-apply r66140 which was disabled as a workaround.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/CodeGenPrepare.cpp')
-rw-r--r-- | lib/Transforms/Scalar/CodeGenPrepare.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index 1f3a13cc9c..85e57661c1 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -327,6 +327,12 @@ static void SplitEdgeNicely(TerminatorInst *TI, unsigned SuccNum, assert(isa<PHINode>(Dest->begin()) && "This should only be called if Dest has a PHI!"); + // Do not split edges to EH landing pads. + if (InvokeInst *Invoke = dyn_cast<InvokeInst>(TI)) { + if (Invoke->getSuccessor(1) == Dest) + return; + } + // As a hack, never split backedges of loops. Even though the copy for any // PHIs inserted on the backedge would be dead for exits from the loop, we // assume that the cost of *splitting* the backedge would be too high. |