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

John Criswell criswell at cs.uiuc.edu
Thu Dec 18 10:44:07 PST 2003


Changes in directory llvm/lib/Transforms/Scalar:

IndVarSimplify.cpp updated: 1.45 -> 1.46

---
Log message:

Merged in RELEASE_11.



---
Diffs of the changes:  (+8 -15)

Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.45 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.46
--- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.45	Mon Dec 15 11:34:02 2003
+++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp	Thu Dec 18 10:42:57 2003
@@ -15,19 +15,19 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/Type.h"
-#include "llvm/iPHINode.h"
-#include "llvm/iOther.h"
 #include "llvm/Analysis/InductionVariable.h"
 #include "llvm/Analysis/LoopInfo.h"
+#include "llvm/iPHINode.h"
+#include "llvm/iOther.h"
+#include "llvm/Type.h"
+#include "llvm/Constants.h"
 #include "llvm/Support/CFG.h"
-#include "llvm/Transforms/Utils/Local.h"
 #include "Support/Debug.h"
 #include "Support/Statistic.h"
 #include "Support/STLExtras.h"
 #include <algorithm>
-using namespace llvm;
+
+namespace llvm {
 
 namespace {
   Statistic<> NumRemoved ("indvars", "Number of aux indvars removed");
@@ -141,8 +141,6 @@
 
     DEBUG(IV->print(std::cerr));
 
-    while (isa<PHINode>(AfterPHIIt)) ++AfterPHIIt;
-
     // Don't do math with pointers...
     const Type *IVTy = IV->Phi->getType();
     if (isa<PointerType>(IVTy)) IVTy = Type::ULongTy;
@@ -188,12 +186,6 @@
       IV->Phi->setName("");
       Val->setName(OldName);
 
-      // Get the incoming values used by the PHI node
-      std::vector<Value*> PHIOps;
-      PHIOps.reserve(IV->Phi->getNumIncomingValues());
-      for (unsigned i = 0, e = IV->Phi->getNumIncomingValues(); i != e; ++i)
-        PHIOps.push_back(IV->Phi->getIncomingValue(i));
-
       // Delete the old, now unused, phi node...
       Header->getInstList().erase(IV->Phi);
 
@@ -250,7 +242,8 @@
                                            "Canonicalize Induction Variables");
 }
 
-Pass *llvm::createIndVarSimplifyPass() {
+Pass *createIndVarSimplifyPass() {
   return new InductionVariableSimplify();
 }
 
+} // End llvm namespace





More information about the llvm-commits mailing list