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

Alkis Evlogimenos alkis at cs.uiuc.edu
Sun Sep 19 23:43:09 PDT 2004



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.242 -> 1.243
---
Log message:

Fix loop condition so that we don't decrement off the beginning of the
list.


---
Diffs of the changes:  (+5 -5)

Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.242 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.243
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.242	Sun Sep 19 14:18:10 2004
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Mon Sep 20 01:42:58 2004
@@ -3002,12 +3002,12 @@
 
   // Otherwise, be a little bit agressive by scanning the local block where we
   // want to check to see if the pointer is already being loaded or stored
-  // from/to.  If so, the previous load or store would hav already trapped, so
-  // there is no harm doing an extra load (also, CSE will later eliminate the
-  // load entirely).
+  // from/to.  If so, the previous load or store would have already trapped,
+  // so there is no harm doing an extra load (also, CSE will later eliminate
+  // the load entirely).
   BasicBlock::iterator BBI = ScanFrom, E = ScanFrom->getParent()->begin();
 
-  do {
+  while (BBI != E) {
     --BBI;
 
     if (LoadInst *LI = dyn_cast<LoadInst>(BBI)) {
@@ -3015,7 +3015,7 @@
     } else if (StoreInst *SI = dyn_cast<StoreInst>(BBI))
       if (SI->getOperand(1) == V) return true;
     
-  } while (BBI != E);
+  }
   return false;
 }
 






More information about the llvm-commits mailing list