[llvm-commits] [SignlessTypes] CVS: llvm/lib/VMCore/ConstantFolding.cpp Constants.cpp Instruction.cpp

Zhou Sheng zhousheng00 at gmail.com
Sun Oct 29 00:36:13 PDT 2006



Changes in directory llvm/lib/VMCore:

ConstantFolding.cpp updated: 1.93.2.9 -> 1.93.2.10
Constants.cpp updated: 1.163.2.10 -> 1.163.2.11
Instruction.cpp updated: 1.53.2.5 -> 1.53.2.6
---
Log message:



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

 ConstantFolding.cpp |   20 ++++++++++----------
 Constants.cpp       |    6 +++---
 Instruction.cpp     |    4 ++--
 3 files changed, 15 insertions(+), 15 deletions(-)


Index: llvm/lib/VMCore/ConstantFolding.cpp
diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.93.2.9 llvm/lib/VMCore/ConstantFolding.cpp:1.93.2.10
--- llvm/lib/VMCore/ConstantFolding.cpp:1.93.2.9	Wed Oct 25 20:58:05 2006
+++ llvm/lib/VMCore/ConstantFolding.cpp	Sun Oct 29 01:35:49 2006
@@ -116,15 +116,15 @@
   virtual Constant *sdiv(const Constant *V1, const Constant *V2) const {
     return SubClassName::SDiv((const ArgType *)V1, (const ArgType *)V2);
   }
+  virtual Constant *fdiv(const Constant *V1, const Constant *V2) const {
+    return SubClassName::FDiv((const ArgType *)V1, (const ArgType *)V2);
+  }
   virtual Constant *urem(const Constant *V1, const Constant *V2) const {
     return SubClassName::URem((const ArgType *)V1, (const ArgType *)V2);
   }
   virtual Constant *srem(const Constant *V1, const Constant *V2) const {
     return SubClassName::SRem((const ArgType *)V1, (const ArgType *)V2);
   }
-  virtual Constant *fdiv(const Constant *V1, const Constant *V2) const {
-    return SubClassName::FDiv((const ArgType *)V1, (const ArgType *)V2);
-  }
   virtual Constant *frem(const Constant *V1, const Constant *V2) const {
     return SubClassName::FRem((const ArgType *)V1, (const ArgType *)V2);
   }
@@ -199,6 +199,7 @@
   static Constant *Mul(const ArgType *V1, const ArgType *V2) { return 0; }
   static Constant *URem(const ArgType *V1, const ArgType *V2) { return 0; }
   static Constant *SRem(const ArgType *V1, const ArgType *V2) { return 0; }
+  static Constant *FRem(const ArgType *V1, const ArgType *V2) { return 0; }
   static Constant *And(const ArgType *V1, const ArgType *V2) { return 0; }
   static Constant *Or (const ArgType *V1, const ArgType *V2) { return 0; }
   static Constant *Xor(const ArgType *V1, const ArgType *V2) { return 0; }
@@ -207,7 +208,6 @@
   static Constant *SDiv(const ArgType *V1, const ArgType *V2) { return 0; }
   static Constant *UDiv(const ArgType *V1, const ArgType *V2) { return 0; }
   static Constant *FDiv(const ArgType *V1, const ArgType *V2) { return 0; }
-  static Constant *FRem(const ArgType *V1, const ArgType *V2) { return 0; }
   static Constant *LessThan(const ArgType *V1, const ArgType *V2) {
     return 0;
   }
@@ -399,15 +399,15 @@
   static Constant *SDiv(const ConstantPacked *V1, const ConstantPacked *V2) {
     return EvalVectorOp(V1, V2, ConstantExpr::getSDiv);
   }
+  static Constant *FDiv(const ConstantPacked *V1, const ConstantPacked *V2) {
+    return EvalVectorOp(V1, V2, ConstantExpr::getFDiv);
+  }
   static Constant *URem(const ConstantPacked *V1, const ConstantPacked *V2) {
     return EvalVectorOp(V1, V2, ConstantExpr::getURem);
   }
   static Constant *SRem(const ConstantPacked *V1, const ConstantPacked *V2) {
     return EvalVectorOp(V1, V2, ConstantExpr::getSRem);
   }
-  static Constant *FDiv(const ConstantPacked *V1, const ConstantPacked *V2) {
-    return EvalVectorOp(V1, V2, ConstantExpr::getFDiv);
-  }
   static Constant *FRem(const ConstantPacked *V1, const ConstantPacked *V2) {
     return EvalVectorOp(V1, V2, ConstantExpr::getFRem);
   }
@@ -1277,10 +1277,10 @@
   case Instruction::Mul:     C = ConstRules::get(V1, V2).mul(V1, V2); break;
   case Instruction::URem:    C = ConstRules::get(V1, V2).urem(V1, V2); break;
   case Instruction::SRem:    C = ConstRules::get(V1, V2).srem(V1, V2); break;
+  case Instruction::FRem:    C = ConstRules::get(V1, V2).frem(V1, V2); break;
   case Instruction::UDiv:    C = ConstRules::get(V1, V2).udiv(V1, V2); break;
   case Instruction::SDiv:    C = ConstRules::get(V1, V2).sdiv(V1, V2); break;
   case Instruction::FDiv:    C = ConstRules::get(V1, V2).fdiv(V1, V2); break;
-  case Instruction::FRem:    C = ConstRules::get(V1, V2).frem(V1, V2); break;
   case Instruction::And:     C = ConstRules::get(V1, V2).op_and(V1, V2); break;
   case Instruction::Or:      C = ConstRules::get(V1, V2).op_or (V1, V2); break;
   case Instruction::Xor:     C = ConstRules::get(V1, V2).op_xor(V1, V2); break;
@@ -1364,10 +1364,10 @@
       return Constant::getNullValue(V1->getType());
     case Instruction::URem:
     case Instruction::SRem:
+    case Instruction::FRem:
     case Instruction::UDiv:
     case Instruction::SDiv:
     case Instruction::FDiv:
-    case Instruction::FRem:
       if (!isa<UndefValue>(V2))     // undef/X -> 0
         return Constant::getNullValue(V1->getType());
       return const_cast<Constant*>(V2);                // X/undef -> undef
@@ -1482,10 +1482,10 @@
     case Instruction::Sub:
     case Instruction::URem:
     case Instruction::SRem:
+    case Instruction::FRem:
     case Instruction::SDiv:
     case Instruction::UDiv:
     case Instruction::FDiv:
-    case Instruction::FRem:
     default:  // These instructions cannot be flopped around.
       break;
     }


Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.163.2.10 llvm/lib/VMCore/Constants.cpp:1.163.2.11
--- llvm/lib/VMCore/Constants.cpp:1.163.2.10	Wed Oct 25 20:58:05 2006
+++ llvm/lib/VMCore/Constants.cpp	Sun Oct 29 01:35:49 2006
@@ -425,15 +425,15 @@
 Constant *ConstantExpr::getSDiv(Constant *C1, Constant *C2) {
   return get(Instruction::SDiv, C1, C2);
 }
+Constant *ConstantExpr::getFDiv(Constant *C1, Constant *C2) {
+  return get(Instruction::FDiv, C1, C2);
+}
 Constant *ConstantExpr::getURem(Constant *C1, Constant *C2) {
   return get(Instruction::URem, C1, C2);
 }
 Constant *ConstantExpr::getSRem(Constant *C1, Constant *C2) {
   return get(Instruction::SRem, C1, C2);
 }
-Constant *ConstantExpr::getFDiv(Constant *C1, Constant *C2) {
-  return get(Instruction::FDiv, C1, C2);
-}
 Constant *ConstantExpr::getFRem(Constant *C1, Constant *C2) {
   return get(Instruction::FRem, C1, C2);
 }


Index: llvm/lib/VMCore/Instruction.cpp
diff -u llvm/lib/VMCore/Instruction.cpp:1.53.2.5 llvm/lib/VMCore/Instruction.cpp:1.53.2.6
--- llvm/lib/VMCore/Instruction.cpp:1.53.2.5	Mon Oct 23 13:13:27 2006
+++ llvm/lib/VMCore/Instruction.cpp	Sun Oct 29 01:35:49 2006
@@ -96,10 +96,10 @@
   case Mul: return "mul";
   case URem: return "urem";
   case SRem: return "srem";
+  case FRem: return "frem";
   case UDiv: return "udiv";
   case SDiv: return "sdiv";
   case FDiv: return "fdiv";
-  case FRem: return "frem";
 
   // Logical operators...
   case And: return "and";
@@ -227,10 +227,10 @@
   switch(op) {
   case URem:
   case SRem:
+  case FRem:
   case UDiv:
   case SDiv:
   case FDiv:
-  case FRem:
   case Load:
   case Store:
   case Call:






More information about the llvm-commits mailing list