summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-10-21 04:09:17 +0000
committerBill Wendling <isanbard@gmail.com>2013-10-21 04:09:17 +0000
commit90dd90afcb0fa05a3abc1c5db0be234fd0dbaf42 (patch)
tree48b2dcdb5d9f41848e31ee40292465b0d612af5b /llvm/lib/Transforms/Utils
parentf8c68da7a9df5bc3316d8f412b83d90327dc89ca (diff)
downloadbcm5719-llvm-90dd90afcb0fa05a3abc1c5db0be234fd0dbaf42.tar.gz
bcm5719-llvm-90dd90afcb0fa05a3abc1c5db0be234fd0dbaf42.zip
Don't eliminate a partially redundant load if it's in a landing pad.
A landing pad can be jumped to only by the unwind edge of an invoke instruction. If we eliminate a partially redundant load in a landing pad, it will create a basic block that violates this constraint. It then leads to other problems down the line if it tries to merge that basic block with the landing pad. Avoid this by not eliminating the load in a landing pad. PR17621 llvm-svn: 193064
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 78217c8efa3..82b8da3a107 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -503,19 +503,7 @@ void llvm::MergeBasicBlockIntoOnlyPred(BasicBlock *DestBB, Pass *P) {
// Splice all the instructions from PredBB to DestBB.
PredBB->getTerminator()->eraseFromParent();
-
- // First splice over the PHI nodes.
- BasicBlock::iterator PI = PredBB->begin();
- while (isa<PHINode>(PI))
- ++PI;
-
- if (PI != PredBB->begin())
- DestBB->getInstList().splice(DestBB->begin(), PredBB->getInstList(),
- PredBB->begin(), PI);
-
- // Now splice over the rest of the instructions.
- DestBB->getInstList().splice(DestBB->getFirstInsertionPt(),
- PredBB->getInstList(), PI, PredBB->end());
+ DestBB->getInstList().splice(DestBB->begin(), PredBB->getInstList());
if (P) {
DominatorTree *DT = P->getAnalysisIfAvailable<DominatorTree>();
@@ -525,7 +513,6 @@ void llvm::MergeBasicBlockIntoOnlyPred(BasicBlock *DestBB, Pass *P) {
DT->eraseNode(PredBB);
}
}
-
// Nuke BB.
PredBB->eraseFromParent();
}
OpenPOWER on IntegriCloud