[llvm-commits] [llvm] r60221 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp

Chris Lattner sabre at nondot.org
Fri Nov 28 14:50:08 PST 2008


Author: lattner
Date: Fri Nov 28 16:50:08 2008
New Revision: 60221

URL: http://llvm.org/viewvc/llvm-project?rev=60221&view=rev
Log:
don't revisit instructions off the beginning of the block.

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

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

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Fri Nov 28 16:50:08 2008
@@ -132,7 +132,8 @@
       
       // If we deleted a store, reinvestigate this instruction.
       if (deletedStore) {
-        --BBI;
+        if (!isa<TerminatorInst>(BB.begin()))
+          --BBI;
         continue;
       }
     }
@@ -160,7 +161,8 @@
              DT.dominates(dep, L))) {
           
           DeleteDeadInstruction(S);
-          --BBI;
+          if (!isa<TerminatorInst>(BB.begin()))
+            --BBI;
           NumFastStores++;
           MadeChange = true;
         } else





More information about the llvm-commits mailing list