summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-07-25 17:56:27 +0000
committerNate Begeman <natebegeman@mac.com>2008-07-25 17:56:27 +0000
commitff795a80a35dc99a1971646de11f088e71d0a2c6 (patch)
tree924c4c62d401f0309aaf00ee3a7c677e8800fdc0
parentb5557abcf13a7b375cae683e9ec200d499645d02 (diff)
downloadllvm-ff795a80a35dc99a1971646de11f088e71d0a2c6.tar.gz
llvm-ff795a80a35dc99a1971646de11f088e71d0a2c6.tar.bz2
llvm-ff795a80a35dc99a1971646de11f088e71d0a2c6.tar.xz
Remove unnecessary implicit argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54031 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Constants.h4
-rw-r--r--lib/VMCore/Constants.cpp14
2 files changed, 10 insertions, 8 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index d91dfca9f8..22acbfcd45 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -564,8 +564,8 @@ protected:
// ConstantExprs in intermediate forms.
static Constant *getTy(const Type *Ty, unsigned Opcode,
Constant *C1, Constant *C2);
- static Constant *getCompareTy(unsigned short pred, Constant *C1,
- Constant *C2, bool isVecCmp = false);
+ static Constant *getCompareTy(unsigned short pred, Constant *C1,
+ Constant *C2);
static Constant *getSelectTy(const Type *Ty,
Constant *C1, Constant *C2, Constant *C3);
static Constant *getGetElementPtrTy(const Type *Ty, Constant *C,
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 48034703c8..8f62a71bbd 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -916,6 +916,8 @@ getWithOperands(const std::vector<Constant*> &Ops) const {
return ConstantExpr::getGetElementPtr(Ops[0], &Ops[1], Ops.size()-1);
case Instruction::ICmp:
case Instruction::FCmp:
+ case Instruction::VICmp:
+ case Instruction::VFCmp:
return ConstantExpr::getCompare(getPredicate(), Ops[0], Ops[1]);
default:
assert(getNumOperands() == 2 && "Must be binary operator?");
@@ -2003,8 +2005,8 @@ Constant *ConstantExpr::getTy(const Type *ReqTy, unsigned Opcode,
}
Constant *ConstantExpr::getCompareTy(unsigned short predicate,
- Constant *C1, Constant *C2,
- bool isVecCmp) {
+ Constant *C1, Constant *C2) {
+ bool isVectorType = C1->getType()->getTypeID() == Type::VectorTyID;
switch (predicate) {
default: assert(0 && "Invalid CmpInst predicate");
case CmpInst::FCMP_FALSE: case CmpInst::FCMP_OEQ: case CmpInst::FCMP_OGT:
@@ -2013,14 +2015,14 @@ Constant *ConstantExpr::getCompareTy(unsigned short predicate,
case CmpInst::FCMP_UEQ: case CmpInst::FCMP_UGT: case CmpInst::FCMP_UGE:
case CmpInst::FCMP_ULT: case CmpInst::FCMP_ULE: case CmpInst::FCMP_UNE:
case CmpInst::FCMP_TRUE:
- return isVecCmp ? getVFCmp(predicate, C1, C2)
- : getFCmp(predicate, C1, C2);
+ return isVectorType ? getVFCmp(predicate, C1, C2)
+ : getFCmp(predicate, C1, C2);
case CmpInst::ICMP_EQ: case CmpInst::ICMP_NE: case CmpInst::ICMP_UGT:
case CmpInst::ICMP_UGE: case CmpInst::ICMP_ULT: case CmpInst::ICMP_ULE:
case CmpInst::ICMP_SGT: case CmpInst::ICMP_SGE: case CmpInst::ICMP_SLT:
case CmpInst::ICMP_SLE:
- return isVecCmp ? getVICmp(predicate, C1, C2)
- : getICmp(predicate, C1, C2);
+ return isVectorType ? getVICmp(predicate, C1, C2)
+ : getICmp(predicate, C1, C2);
}
}