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

Chris Lattner lattner at cs.uiuc.edu
Tue Dec 23 02:05:03 PST 2003


Changes in directory llvm/lib/Analysis:

Expressions.cpp updated: 1.39 -> 1.40
InductionVariable.cpp updated: 1.33 -> 1.34

---
Log message:

rename ClassifyExpression -> ClassifyExpr


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

Index: llvm/lib/Analysis/Expressions.cpp
diff -u llvm/lib/Analysis/Expressions.cpp:1.39 llvm/lib/Analysis/Expressions.cpp:1.40
--- llvm/lib/Analysis/Expressions.cpp:1.39	Tue Dec 23 00:44:41 2003
+++ llvm/lib/Analysis/Expressions.cpp	Tue Dec 23 02:04:02 2003
@@ -233,13 +233,13 @@
 }
 
 
-// ClassifyExpression: Analyze an expression to determine the complexity of the
-// expression, and which other values it depends on.  
+// ClassifyExpr: Analyze an expression to determine the complexity of the
+// expression, and which other values it depends on.
 //
 // Note that this analysis cannot get into infinite loops because it treats PHI
 // nodes as being an unknown linear expression.
 //
-ExprType llvm::ClassifyExpression(Value *Expr) {
+ExprType llvm::ClassifyExpr(Value *Expr) {
   assert(Expr != 0 && "Can't classify a null expression!");
   if (Expr->getType() == Type::FloatTy || Expr->getType() == Type::DoubleTy)
     return Expr;   // FIXME: Can't handle FP expressions
@@ -266,14 +266,14 @@
 
   switch (I->getOpcode()) {       // Handle each instruction type separately
   case Instruction::Add: {
-    ExprType Left (ClassifyExpression(I->getOperand(0)));
-    ExprType Right(ClassifyExpression(I->getOperand(1)));
+    ExprType Left (ClassifyExpr(I->getOperand(0)));
+    ExprType Right(ClassifyExpr(I->getOperand(1)));
     return handleAddition(Left, Right, I);
   }  // end case Instruction::Add
 
   case Instruction::Sub: {
-    ExprType Left (ClassifyExpression(I->getOperand(0)));
-    ExprType Right(ClassifyExpression(I->getOperand(1)));
+    ExprType Left (ClassifyExpr(I->getOperand(0)));
+    ExprType Right(ClassifyExpr(I->getOperand(1)));
     ExprType RightNeg = negate(Right, I);
     if (RightNeg.Var == I && !RightNeg.Offset && !RightNeg.Scale)
       return I;   // Could not negate value...
@@ -281,9 +281,9 @@
   }  // end case Instruction::Sub
 
   case Instruction::Shl: { 
-    ExprType Right(ClassifyExpression(I->getOperand(1)));
+    ExprType Right(ClassifyExpr(I->getOperand(1)));
     if (Right.ExprTy != ExprType::Constant) break;
-    ExprType Left(ClassifyExpression(I->getOperand(0)));
+    ExprType Left(ClassifyExpr(I->getOperand(0)));
     if (Right.Offset == 0) return Left;   // shl x, 0 = x
     assert(Right.Offset->getType() == Type::UByteTy &&
 	   "Shift amount must always be a unsigned byte!");
@@ -308,8 +308,8 @@
   }  // end case Instruction::Shl
 
   case Instruction::Mul: {
-    ExprType Left (ClassifyExpression(I->getOperand(0)));
-    ExprType Right(ClassifyExpression(I->getOperand(1)));
+    ExprType Left (ClassifyExpr(I->getOperand(0)));
+    ExprType Right(ClassifyExpr(I->getOperand(1)));
     if (Left.ExprTy > Right.ExprTy)
       std::swap(Left, Right);   // Make left be simpler than right
 
@@ -323,7 +323,7 @@
   } // end case Instruction::Mul
 
   case Instruction::Cast: {
-    ExprType Src(ClassifyExpression(I->getOperand(0)));
+    ExprType Src(ClassifyExpr(I->getOperand(0)));
     const Type *DestTy = I->getType();
     if (isa<PointerType>(DestTy))
       DestTy = Type::ULongTy;  // Pointer types are represented as ulong


Index: llvm/lib/Analysis/InductionVariable.cpp
diff -u llvm/lib/Analysis/InductionVariable.cpp:1.33 llvm/lib/Analysis/InductionVariable.cpp:1.34
--- llvm/lib/Analysis/InductionVariable.cpp:1.33	Sun Dec 21 23:26:29 2003
+++ llvm/lib/Analysis/InductionVariable.cpp	Tue Dec 23 02:04:02 2003
@@ -89,8 +89,8 @@
   Value *V2 = Phi->getIncomingValue(1);
 
   if (L == 0) {  // No loop information?  Base everything on expression analysis
-    ExprType E1 = ClassifyExpression(V1);
-    ExprType E2 = ClassifyExpression(V2);
+    ExprType E1 = ClassifyExpr(V1);
+    ExprType E2 = ClassifyExpr(V2);
 
     if (E1.ExprTy > E2.ExprTy)        // Make E1 be the simpler expression
       std::swap(E1, E2);
@@ -152,7 +152,7 @@
     }
 
     if (Step == 0) {                  // Unrecognized step value...
-      ExprType StepE = ClassifyExpression(V2);
+      ExprType StepE = ClassifyExpr(V2);
       if (StepE.ExprTy != ExprType::Linear ||
           StepE.Var != Phi) return;
 
@@ -160,7 +160,7 @@
       if (isa<PointerType>(ETy)) ETy = Type::ULongTy;
       Step  = (Value*)(StepE.Offset ? StepE.Offset : ConstantInt::get(ETy, 0));
     } else {   // We were able to get a step value, simplify with expr analysis
-      ExprType StepE = ClassifyExpression(Step);
+      ExprType StepE = ClassifyExpr(Step);
       if (StepE.ExprTy == ExprType::Linear && StepE.Offset == 0) {
         // No offset from variable?  Grab the variable
         Step = StepE.Var;





More information about the llvm-commits mailing list