[llvm-commits] CVS: llvm/lib/Transforms/Scalar/PRE.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Nov 30 09:09:20 PST 2004



Changes in directory llvm/lib/Transforms/Scalar:

PRE.cpp updated: 1.12 -> 1.13
---
Log message:

This pass is completely broken.


---
Diffs of the changes:  (+4 -11)

Index: llvm/lib/Transforms/Scalar/PRE.cpp
diff -u llvm/lib/Transforms/Scalar/PRE.cpp:1.12 llvm/lib/Transforms/Scalar/PRE.cpp:1.13
--- llvm/lib/Transforms/Scalar/PRE.cpp:1.12	Mon Oct 25 13:45:16 2004
+++ llvm/lib/Transforms/Scalar/PRE.cpp	Tue Nov 30 11:09:06 2004
@@ -152,20 +152,13 @@
 bool PRE::ProcessBlock(BasicBlock *BB) {
   bool Changed = false;
 
+  // DISABLED: This pass invalidates iterators and then uses them.
+  return false;
+
   // PRE expressions first defined in this block...
-  Instruction *PrevInst = 0;
   for (BasicBlock::iterator I = BB->begin(); I != BB->end(); )
-    if (ProcessExpression(I)) {
-      // The current instruction may have been deleted, make sure to back up to
-      // PrevInst instead.
-      if (PrevInst)
-        I = PrevInst;
-      else
-        I = BB->begin();
+    if (ProcessExpression(I++))
       Changed = true;
-    } else {
-      PrevInst = I++;
-    }
 
   return Changed;
 }






More information about the llvm-commits mailing list