Home | History | Annotate | Download | only in IR

Lines Matching refs:V2

727                                               Constant *V1, Constant *V2) {
729 if (Cond->isNullValue()) return V2;
740 Constant *V2Element = ConstantExpr::getExtractElement(V2,
761 return V2;
763 if (isa<UndefValue>(V1)) return V2;
764 if (isa<UndefValue>(V2)) return V1;
765 if (V1 == V2) return V1;
770 return ConstantExpr::getSelect(Cond, TrueVal->getOperand(1), V2);
772 if (ConstantExpr *FalseVal = dyn_cast<ConstantExpr>(V2)) {
831 Constant *V2,
857 Type *Ty = IntegerType::get(V2->getContext(), 32);
859 ConstantExpr::getExtractElement(V2,
1330 static FCmpInst::Predicate evaluateFCmpRelation(Constant *V1, Constant *V2) {
1331 assert(V1->getType() == V2->getType() &&
1335 if (V1 == V2) return FCmpInst::FCMP_OEQ;
1338 if (!isa<ConstantExpr>(V2)) {
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);
1418 static ICmpInst::Predicate evaluateICmpRelation(Constant *V1, Constant *V2,
1420 assert(V1->getType() == V2->getType() &&
1422 if (V1 == V2) return ICmpInst::ICMP_EQ;
1426 if (!isa<GlobalValue>(V2) && !isa<ConstantExpr>(V2) &&
1427 !isa<BlockAddress>(V2)) {
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);
1455 if (isa<ConstantExpr>(V2)) { // Swap as necessary.
1457 evaluateICmpRelation(V2, V1, isSigned);
1466 if (const GlobalValue *GV2 = dyn_cast<GlobalValue>(V2)) {
1468 } else if (isa<BlockAddress>(V2)) {
1471 assert(isa<ConstantPointerNull>(V2) && "Canonicalization guarantee!");
1478 if (isa<ConstantExpr>(V2)) { // Swap as necessary.
1480 evaluateICmpRelation(V2, V1, isSigned);
1489 if (const BlockAddress *BA2 = dyn_cast<BlockAddress>(V2)) {
1497 assert((isa<ConstantPointerNull>(V2) || isa<GlobalValue>(V2)) &&
1522 if (V2->isNullValue() &&
1536 if (isa<ConstantPointerNull>(V2)) {
1559 } else if (const GlobalValue *GV2 = dyn_cast<GlobalValue>(V2)) {
1586 ConstantExpr *CE2 = cast<ConstantExpr>(V2);
1733 APInt V2 = cast<ConstantInt>(C2)->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));