[llvm-commits] CVS: llvm/lib/Analysis/LoadValueNumbering.cpp

Chris Lattner sabre at nondot.org
Tue Apr 17 10:53:03 PDT 2007



Changes in directory llvm/lib/Analysis:

LoadValueNumbering.cpp updated: 1.38 -> 1.39
---
Log message:

Remove use of Instruction::getNext


---
Diffs of the changes:  (+12 -9)

 LoadValueNumbering.cpp |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)


Index: llvm/lib/Analysis/LoadValueNumbering.cpp
diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.38 llvm/lib/Analysis/LoadValueNumbering.cpp:1.39
--- llvm/lib/Analysis/LoadValueNumbering.cpp:1.38	Fri Apr  6 23:43:07 2007
+++ llvm/lib/Analysis/LoadValueNumbering.cpp	Tue Apr 17 12:52:45 2007
@@ -336,15 +336,18 @@
   // we see any candidate loads, then we know they have the same value # as LI.
   //
   bool LoadInvalidatedInBBAfter = false;
-  for (BasicBlock::iterator I = LI->getNext(); I != LoadBB->end(); ++I) {
-    // If this instruction is a load, then this instruction returns the same
-    // value as LI.
-    if (isa<LoadInst>(I) && cast<LoadInst>(I)->getOperand(0) == LoadPtr)
-      RetVals.push_back(I);
-
-    if (AA.getModRefInfo(I, LoadPtr, LoadSize) & AliasAnalysis::Mod) {
-      LoadInvalidatedInBBAfter = true;
-      break;
+  {
+    BasicBlock::iterator I = LI;
+    for (++I; I != LoadBB->end(); ++I) {
+      // If this instruction is a load, then this instruction returns the same
+      // value as LI.
+      if (isa<LoadInst>(I) && cast<LoadInst>(I)->getOperand(0) == LoadPtr)
+        RetVals.push_back(I);
+
+      if (AA.getModRefInfo(I, LoadPtr, LoadSize) & AliasAnalysis::Mod) {
+        LoadInvalidatedInBBAfter = true;
+        break;
+      }
     }
   }
 






More information about the llvm-commits mailing list