Lines Matching refs:V1
727 Constant *V1, Constant *V2) {
730 if (Cond->isAllOnesValue()) return V1;
736 for (unsigned i = 0, e = V1->getType()->getVectorNumElements(); i != e;++i){
738 Constant *V1Element = ConstantExpr::getExtractElement(V1,
755 if (Result.size() == V1->getType()->getVectorNumElements())
760 if (isa<UndefValue>(V1)) return V1;
763 if (isa<UndefValue>(V1)) return V2;
764 if (isa<UndefValue>(V2)) return V1;
765 if (V1 == V2) return V1;
767 if (ConstantExpr *TrueVal = dyn_cast<ConstantExpr>(V1)) {
775 return ConstantExpr::getSelect(Cond, V1, FalseVal->getOperand(2));
830 Constant *llvm::ConstantFoldShuffleVectorInstruction(Constant *V1,
834 Type *EltTy = V1->getType()->getVectorElementType();
843 unsigned SrcNumElts = V1->getType()->getVectorNumElements();
862 Type *Ty = IntegerType::get(V1->getContext(), 32);
863 InElt = ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, Elt));
1330 static FCmpInst::Predicate evaluateFCmpRelation(Constant *V1, Constant *V2) {
1331 assert(V1->getType() == V2->getType() &&
1335 if (V1 == V2) return FCmpInst::FCMP_OEQ;
1337 if (!isa<ConstantExpr>(V1)) {
1342 ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ, V1, V2));
1346 ConstantExpr::getFCmp(FCmpInst::FCMP_OLT, V1, V2));
1350 ConstantExpr::getFCmp(FCmpInst::FCMP_OGT, V1, V2));
1359 FCmpInst::Predicate SwappedRelation = evaluateFCmpRelation(V2, V1);
1365 ConstantExpr *CE1 = cast<ConstantExpr>(V1);
1418 static ICmpInst::Predicate evaluateICmpRelation(Constant *V1, Constant *V2,
1420 assert(V1->getType() == V2->getType() &&
1422 if (V1 == V2) return ICmpInst::ICMP_EQ;
1424 if (!isa<ConstantExpr>(V1) && !isa<GlobalValue>(V1) &&
1425 !isa<BlockAddress>(V1)) {
1432 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2));
1436 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2));
1440 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2));
1450 evaluateICmpRelation(V2, V1, isSigned);
1454 } else if (const GlobalValue *GV = dyn_cast<GlobalValue>(V1)) {
1457 evaluateICmpRelation(V2, V1, isSigned);
1477 } else if (const BlockAddress *BA = dyn_cast<BlockAddress>(V1)) {
1480 evaluateICmpRelation(V2, V1, isSigned);
1504 ConstantExpr *CE1 = cast<ConstantExpr>(V1);
1732 APInt V1 = cast<ConstantInt>(C1)->getValue();
1736 case ICmpInst::ICMP_EQ: return ConstantInt::get(ResultTy, V1 == V2);
1737 case ICmpInst::ICMP_NE: return ConstantInt::get(ResultTy, V1 != V2);
1738 case ICmpInst::ICMP_SLT: return ConstantInt::get(ResultTy, V1.slt(V2));
1739 case ICmpInst::ICMP_SGT: return ConstantInt::get(ResultTy, V1.sgt(V2));
1740 case ICmpInst::ICMP_SLE: return ConstantInt::get(ResultTy, V1.sle(V2));
1741 case ICmpInst::ICMP_SGE: return ConstantInt::get(ResultTy, V1.sge(V2));
1742 case ICmpInst::ICMP_ULT: return ConstantInt::get(ResultTy, V1.ult(V2));
1743 case ICmpInst::ICMP_UGT: return ConstantInt::get(ResultTy, V1.ugt(V2));
1744 case ICmpInst::ICMP_ULE: return ConstantInt::get(ResultTy, V1.ule(V2));
1745 case ICmpInst::ICMP_UGE: return ConstantInt::get(ResultTy, V1.uge(V2));