[llvm-commits] [llvm] r66859 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Dale Johannesen dalej at apple.com
Thu Mar 12 18:05:24 PDT 2009


Author: johannes
Date: Thu Mar 12 20:05:24 2009
New Revision: 66859

URL: http://llvm.org/viewvc/llvm-project?rev=66859&view=rev
Log:
Fix one more place where debug info affected
codegen (speculative execution).


Modified:
    llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=66859&r1=66858&r2=66859&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Thu Mar 12 20:05:24 2009
@@ -1069,9 +1069,12 @@
   }
 
   // If we get here, we can hoist the instruction. Try to place it
-  // before the icmp instruction preceeding the conditional branch.
+  // before the icmp instruction preceding the conditional branch.
   BasicBlock::iterator InsertPos = BI;
-  if (InsertPos != BIParent->begin()) 
+  if (InsertPos != BIParent->begin())
+    --InsertPos;
+  // Skip debug info between condition and branch.
+  while (InsertPos != BIParent->begin() && isa<DbgInfoIntrinsic>(InsertPos))
     --InsertPos;
   if (InsertPos == BrCond && !isa<PHINode>(BrCond)) {
     SmallPtrSet<Instruction *, 4> BB1Insns;





More information about the llvm-commits mailing list