diff options
author | Devang Patel <dpatel@apple.com> | 2011-05-26 23:16:48 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-05-26 23:16:48 +0000 |
commit | bf22998f21fd61b53ec8b40c6255ec31091c881e (patch) | |
tree | 754204dbb6a5909f1e5becf625b531ad9e030968 /llvm/lib | |
parent | b362884ca92ce7de431de913a653827d41076683 (diff) | |
download | bcm5719-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.cpp | 3 |
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)) |