[llvm-commits] [llvm] r67064 - /llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp

Dale Johannesen dalej at apple.com
Mon Mar 16 17:38:25 PDT 2009


Author: johannes
Date: Mon Mar 16 19:38:24 2009
New Revision: 67064

URL: http://llvm.org/viewvc/llvm-project?rev=67064&view=rev
Log:
Fix a debug info dependency in jump threading.


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

Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=67064&r1=67063&r2=67064&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Mon Mar 16 19:38:24 2009
@@ -432,10 +432,13 @@
   
   // If DESTBB *just* contains the switch, then we can forward edges from PREDBB
   // directly to their destination.  This does not introduce *any* code size
-  // growth.
+  // growth.  Skip debug info first.
+  BasicBlock::iterator BBI = DestBB->begin();
+  while (isa<DbgInfoIntrinsic>(BBI))
+    BBI++;
   
   // FIXME: Thread if it just contains a PHI.
-  if (isa<SwitchInst>(DestBB->begin())) {
+  if (isa<SwitchInst>(BBI)) {
     bool MadeChange = false;
     // Ignore the default edge for now.
     for (unsigned i = 1, e = DestSI->getNumSuccessors(); i != e; ++i) {





More information about the llvm-commits mailing list