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

Chris Lattner sabre at nondot.org
Sun Sep 17 12:15:02 PDT 2006



Changes in directory llvm/lib/VMCore:

ConstantFolding.cpp updated: 1.90 -> 1.91
Constants.cpp updated: 1.159 -> 1.160
Instruction.cpp updated: 1.52 -> 1.53
---
Log message:

Add new SetCondInst::isRelational/isEquality methods.  Rename 
Instruction::isRelational to Instruction::isComparison.


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

 ConstantFolding.cpp |    2 +-
 Constants.cpp       |    4 ++--
 Instruction.cpp     |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)


Index: llvm/lib/VMCore/ConstantFolding.cpp
diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.90 llvm/lib/VMCore/ConstantFolding.cpp:1.91
--- llvm/lib/VMCore/ConstantFolding.cpp:1.90	Sun Aug 27 07:54:02 2006
+++ llvm/lib/VMCore/ConstantFolding.cpp	Sun Sep 17 14:14:47 2006
@@ -1212,7 +1212,7 @@
   // If we successfully folded the expression, return it now.
   if (C) return C;
 
-  if (SetCondInst::isRelational(Opcode)) {
+  if (SetCondInst::isComparison(Opcode)) {
     if (isa<UndefValue>(V1) || isa<UndefValue>(V2))
       return UndefValue::get(Type::BoolTy);
     switch (evaluateRelation(const_cast<Constant*>(V1),


Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.159 llvm/lib/VMCore/Constants.cpp:1.160
--- llvm/lib/VMCore/Constants.cpp:1.159	Sun Aug 27 07:54:02 2006
+++ llvm/lib/VMCore/Constants.cpp	Sun Sep 17 14:14:47 2006
@@ -1419,7 +1419,7 @@
   assert(C1->getType() == C2->getType() &&
          "Operand types in binary constant expression should match");
 
-  if (ReqTy == C1->getType() || (Instruction::isRelational(Opcode) &&
+  if (ReqTy == C1->getType() || (Instruction::isComparison(Opcode) &&
                                  ReqTy == Type::BoolTy))
     if (Constant *FC = ConstantFoldBinaryInstruction(Opcode, C1, C2))
       return FC;          // Fold a few common cases...
@@ -1462,7 +1462,7 @@
   }
 #endif
 
-  if (Instruction::isRelational(Opcode))
+  if (Instruction::isComparison(Opcode))
     return getTy(Type::BoolTy, Opcode, C1, C2);
   else
     return getTy(C1->getType(), Opcode, C1, C2);


Index: llvm/lib/VMCore/Instruction.cpp
diff -u llvm/lib/VMCore/Instruction.cpp:1.52 llvm/lib/VMCore/Instruction.cpp:1.53
--- llvm/lib/VMCore/Instruction.cpp:1.52	Wed Jun 21 11:53:47 2006
+++ llvm/lib/VMCore/Instruction.cpp	Sun Sep 17 14:14:47 2006
@@ -200,9 +200,9 @@
   }
 }
 
-/// isRelational - Return true if the instruction is a Set* instruction:
+/// isComparison - Return true if the instruction is a Set* instruction:
 ///
-bool Instruction::isRelational(unsigned op) {
+bool Instruction::isComparison(unsigned op) {
   switch (op) {
   case SetEQ:
   case SetNE:






More information about the llvm-commits mailing list