[llvm-commits] [llvm] r132164 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Devang Patel dpatel at apple.com
Thu May 26 16:16:48 PDT 2011


Author: dpatel
Date: Thu May 26 18:16:48 2011
New Revision: 132164

URL: http://llvm.org/viewvc/llvm-project?rev=132164&view=rev
Log:
Do not insert anything after terminator.

Modified:
    llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=132164&r1=132163&r2=132164&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Thu May 26 18:16:48 2011
@@ -554,7 +554,8 @@
   // 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))





More information about the llvm-commits mailing list