summaryrefslogtreecommitdiff
path: root/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-04-22 01:07:09 +0000
committerBill Wendling <isanbard@gmail.com>2011-04-22 01:07:09 +0000
commitd3dbd5f5cdb54b5e9472ec6040612fc4d898d297 (patch)
treebb31a834fcae3ee49132ed02fe8c4af637eff2bf /lib/CodeGen/BranchFolding.cpp
parentc1fe100f355931c6a8368be00d8f7251d10b1920 (diff)
downloadllvm-d3dbd5f5cdb54b5e9472ec6040612fc4d898d297.tar.gz
llvm-d3dbd5f5cdb54b5e9472ec6040612fc4d898d297.tar.bz2
llvm-d3dbd5f5cdb54b5e9472ec6040612fc4d898d297.tar.xz
Branch folding is folding a landing pad into a regular BB.
An exception is thrown via a call to _cxa_throw, which we don't expect to return. Therefore, the "true" part of the invoke goes to a BB that has 'unreachable' as its only instruction. This is lowered into an empty MachineBB. The landing pad for this invoke, however, is directly after the "true" MBB. When the empty MBB is removed, the landing pad is directly below the BB with the invoke call. The unconditional branch is removed and then the two blocks are merged together. The testcase is too big for a regression test. <rdar://problem/9305728> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129965 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r--lib/CodeGen/BranchFolding.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 78a87431fe..77043406bc 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -1048,7 +1048,7 @@ ReoptimizeBlock:
// AnalyzeBranch.
if (PriorCond.empty() && !PriorTBB && MBB->pred_size() == 1 &&
PrevBB.succ_size() == 1 &&
- !MBB->hasAddressTaken()) {
+ !MBB->hasAddressTaken() && !MBB->isLandingPad()) {
DEBUG(dbgs() << "\nMerging into block: " << PrevBB
<< "From MBB: " << *MBB);
PrevBB.splice(PrevBB.end(), MBB, MBB->begin(), MBB->end());