summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-05-26 23:16:48 +0000
committerDevang Patel <dpatel@apple.com>2011-05-26 23:16:48 +0000
commitbf22998f21fd61b53ec8b40c6255ec31091c881e (patch)
tree754204dbb6a5909f1e5becf625b531ad9e030968 /llvm/lib
parentb362884ca92ce7de431de913a653827d41076683 (diff)
downloadbcm5719-llvm-bf22998f21fd61b53ec8b40c6255ec31091c881e.tar.gz
bcm5719-llvm-bf22998f21fd61b53ec8b40c6255ec31091c881e.zip
Do not insert anything after terminator.
llvm-svn: 132164
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
index da6bf316f31..dbf0e08607c 100644
--- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -554,7 +554,8 @@ bool CodeGenPrepare::OptimizeCallInst(CallInst *CI) {
// find a node corresponding to the value.
if (DbgValueInst *DVI = dyn_cast<DbgValueInst>(CI))
if (Instruction *VI = dyn_cast_or_null<Instruction>(DVI->getValue()))
- if (DVI->getParent() != VI->getParent() || DT->dominates(DVI, VI)) {
+ if (!VI->isTerminator() &&
+ DVI->getParent() != VI->getParent() || DT->dominates(DVI, VI)) {
DEBUG(dbgs() << "Moving Debug Value before :\n" << *DVI << ' ' << *VI);
DVI->removeFromParent();
if (isa<PHINode>(VI))
OpenPOWER on IntegriCloud