aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-09-20 06:42:58 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-09-20 06:42:58 +0000
commit7b6ec600c50e88112835021988b823973fbd7d36 (patch)
tree7b3c92bccbed813410bd91ef6e68b29c0722ccec /lib/Transforms
parent2ac3f19e90c4d3625b3d546448ec87724b5ec7a9 (diff)
Fix loop condition so that we don't decrement off the beginning of the
list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16440 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index ede265a44e..d2888860af 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -3002,12 +3002,12 @@ static bool isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom) {
// 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 @@ static bool isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom) {
} else if (StoreInst *SI = dyn_cast<StoreInst>(BBI))
if (SI->getOperand(1) == V) return true;
- } while (BBI != E);
+ }
return false;
}