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 | 77ba0164fe631e573aec216dd44ea18a1cd76df4 (patch) | |
tree | 5dd10e5e8778697f412f6c7ba8e928146a9db7d1 /lib/Transforms/Scalar/CodeGenPrepare.cpp | |
parent | 62660310d9e5f9ecf329fd3cacb67c344a12ddbc (diff) |
Do not insert anything after terminator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/CodeGenPrepare.cpp')
-rw-r--r-- | lib/Transforms/Scalar/CodeGenPrepare.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index da6bf316f3..dbf0e08607 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/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)) |