summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2015-12-08 23:00:03 +0000
committerReid Kleckner <rnk@google.com>2015-12-08 23:00:03 +0000
commit8de1fe23ed8a5cd56a5f3b12cd6a9135a24000ae (patch)
treed89f743661b5313f9c13e70009c84a9168011508 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parentd87e4354a739ac9e372bc347db9755992b80debe (diff)
downloadbcm5719-llvm-8de1fe23ed8a5cd56a5f3b12cd6a9135a24000ae.tar.gz
bcm5719-llvm-8de1fe23ed8a5cd56a5f3b12cd6a9135a24000ae.zip
[CGP] Reimplement r255055 a different way
llvm-svn: 255070
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index d619044e86c..30af1c54fac 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -5251,6 +5251,10 @@ bool CodeGenPrepare::placeDbgValues(Function &F) {
Instruction *VI = dyn_cast_or_null<Instruction>(DVI->getValue());
if (VI && VI != PrevNonDbgInst && !VI->isTerminator()) {
+ // If VI is a phi in a block with an EHPad terminator, we can't insert
+ // after it.
+ if (isa<PHINode>(VI) && VI->getParent()->getTerminator()->isEHPad())
+ continue;
DEBUG(dbgs() << "Moving Debug Value before :\n" << *DVI << ' ' << *VI);
DVI->removeFromParent();
if (isa<PHINode>(VI))
OpenPOWER on IntegriCloud