[llvm-commits] [llvm] r65915 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Dale Johannesen dalej at apple.com
Mon Mar 2 17:43:03 PST 2009


Author: johannes
Date: Mon Mar  2 19:43:03 2009
New Revision: 65915

URL: http://llvm.org/viewvc/llvm-project?rev=65915&view=rev
Log:
Don't count DebugInfo instructions in another limit
(lest they affect codegen).


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

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

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Mar  2 19:43:03 2009
@@ -11439,12 +11439,18 @@
                                 SI.getAlignment()))
     SI.setAlignment(KnownAlign);
 
-  // Do really simple DSE, to catch cases where there are several consequtive
+  // Do really simple DSE, to catch cases where there are several consecutive
   // stores to the same location, separated by a few arithmetic operations. This
   // situation often occurs with bitfield accesses.
   BasicBlock::iterator BBI = &SI;
   for (unsigned ScanInsts = 6; BBI != SI.getParent()->begin() && ScanInsts;
        --ScanInsts) {
+    // Don't count debug info directives, lest they affect codegen.
+    if (isa<DbgInfoIntrinsic>(BBI)) {
+      ScanInsts++;
+      --BBI;
+      continue;
+    }    
     --BBI;
     
     if (StoreInst *PrevSI = dyn_cast<StoreInst>(BBI)) {





More information about the llvm-commits mailing list