summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-08-26 21:18:55 +0000
committerBill Wendling <isanbard@gmail.com>2011-08-26 21:18:55 +0000
commitfee8eda35b3ca2be79bc811602a573de2c565210 (patch)
treec8eed0fb8ba4aa976d0a265eb918166eb367f557 /llvm/lib
parentfd60f60ed1617f1156c66f23d87dc90da0862067 (diff)
downloadbcm5719-llvm-fee8eda35b3ca2be79bc811602a573de2c565210.tar.gz
bcm5719-llvm-fee8eda35b3ca2be79bc811602a573de2c565210.zip
Split the landing pad block only if it's a critical edge. Also intelligently
split it in the other place where we're splitting critical edges. llvm-svn: 138658
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SjLjEHPrepare.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SjLjEHPrepare.cpp b/llvm/lib/CodeGen/SjLjEHPrepare.cpp
index ebed3d2b882..e18cbeaeb36 100644
--- a/llvm/lib/CodeGen/SjLjEHPrepare.cpp
+++ b/llvm/lib/CodeGen/SjLjEHPrepare.cpp
@@ -143,7 +143,19 @@ void SjLjEHPass::markInvokeCallSite(InvokeInst *II, int InvokeNo,
// If the unwind edge has phi nodes, split the edge.
if (isa<PHINode>(II->getUnwindDest()->begin())) {
- SplitCriticalEdge(II, 1, this);
+ // FIXME: New EH - This if-condition will be always true in the new scheme.
+ if (II->getUnwindDest()->isLandingPad()) {
+ if (isCriticalEdge(II, 1)) {
+ SmallVector<BasicBlock*, 2> NewBBs;
+ SplitLandingPadPredecessors(II->getUnwindDest(), II->getParent(),
+ ".1", ".2", this, NewBBs);
+ LPadSuccMap[II] = *succ_begin(NewBBs[0]);
+ } else {
+ LPadSuccMap[II] = II->getUnwindDest();
+ }
+ } else {
+ SplitCriticalEdge(II, 1, this);
+ }
// If there are any phi nodes left, they must have a single predecessor.
while (PHINode *PN = dyn_cast<PHINode>(II->getUnwindDest()->begin())) {
@@ -194,10 +206,14 @@ splitLiveRangesAcrossInvokes(SmallVector<InvokeInst*,16> &Invokes) {
// FIXME: New EH - This if-condition will be always true in the new scheme.
if (II->getUnwindDest()->isLandingPad()) {
- SmallVector<BasicBlock*, 2> NewBBs;
- SplitLandingPadPredecessors(II->getUnwindDest(), II->getParent(),
- ".1", ".2", this, NewBBs);
- LPadSuccMap[II] = *succ_begin(NewBBs[0]);
+ if (isCriticalEdge(II, 1)) {
+ SmallVector<BasicBlock*, 2> NewBBs;
+ SplitLandingPadPredecessors(II->getUnwindDest(), II->getParent(),
+ ".1", ".2", this, NewBBs);
+ LPadSuccMap[II] = *succ_begin(NewBBs[0]);
+ } else {
+ LPadSuccMap[II] = II->getUnwindDest();
+ }
} else {
SplitCriticalEdge(II, 1, this);
}
OpenPOWER on IntegriCloud