diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2008-04-25 16:53:59 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2008-04-25 16:53:59 +0000 |
commit | 280a6e607d8eb7401749a92db624a82de47da777 (patch) | |
tree | 040d0b406293ebcc56801552313daa6136ee5e6c /lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | 419ace9bda6abaaa65560708064b210b4e48880f (diff) |
Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | lib/Transforms/Utils/SimplifyCFG.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 8b8195ef1e..7f37b45f2d 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1342,8 +1342,6 @@ bool llvm::SimplifyCFG(BasicBlock *BB) { SmallVector<BasicBlock*, 8> UncondBranchPreds; SmallVector<BranchInst*, 8> CondBranchPreds; for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) { - if ((*PI)->getUnwindDest() == BB) continue; - TerminatorInst *PTI = (*PI)->getTerminator(); if (BranchInst *BI = dyn_cast<BranchInst>(PTI)) { if (BI->isUnconditional()) @@ -1408,14 +1406,8 @@ bool llvm::SimplifyCFG(BasicBlock *BB) { SmallVector<BasicBlock*, 8> Preds(pred_begin(BB), pred_end(BB)); while (!Preds.empty()) { BasicBlock *Pred = Preds.back(); - - if (Pred->getUnwindDest() == BB) { - Pred->setUnwindDest(NULL); - Changed = true; - } - if (BranchInst *BI = dyn_cast<BranchInst>(Pred->getTerminator())) { - if (BI->isUnconditional() && BI->getSuccessor(0) == BB) { + if (BI->isUnconditional()) { Pred->getInstList().pop_back(); // nuke uncond branch new UnwindInst(Pred); // Use unwind. Changed = true; @@ -1840,7 +1832,6 @@ bool llvm::SimplifyCFG(BasicBlock *BB) { BasicBlock *OnlySucc = 0; if (OnlyPred && OnlyPred != BB && // Don't break self loops - OnlyPred->getUnwindDest() != BB && OnlyPred->getTerminator()->getOpcode() != Instruction::Invoke) { // Check to see if there is only one distinct successor... succ_iterator SI(succ_begin(OnlyPred)), SE(succ_end(OnlyPred)); @@ -1852,8 +1843,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) { } } - if (OnlySucc && (BB->getUnwindDest() == OnlyPred->getUnwindDest() || - !BB->getUnwindDest() || !OnlyPred->getUnwindDest())) { + if (OnlySucc) { DOUT << "Merging: " << *BB << "into: " << *OnlyPred; // Resolve any PHI nodes at the start of the block. They are all @@ -1873,10 +1863,6 @@ bool llvm::SimplifyCFG(BasicBlock *BB) { // Move all definitions in the successor to the predecessor. OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList()); - // Move the unwind destination block - if (!OnlyPred->getUnwindDest() && BB->getUnwindDest()) - OnlyPred->setUnwindDest(BB->getUnwindDest()); - // Make all PHI nodes that referred to BB now refer to Pred as their // source. BB->replaceAllUsesWith(OnlyPred); |