Lines Matching refs:V2
530 Constant *V1, Constant *V2) { in ConstantFoldSelectInstruction() argument
532 if (Cond->isNullValue()) return V2; in ConstantFoldSelectInstruction()
544 Constant *V2Element = ConstantExpr::getExtractElement(V2, in ConstantFoldSelectInstruction()
570 return V2; in ConstantFoldSelectInstruction()
573 if (V1 == V2) return V1; in ConstantFoldSelectInstruction()
576 return V2; in ConstantFoldSelectInstruction()
577 if (isa<PoisonValue>(V2)) in ConstantFoldSelectInstruction()
601 if (isa<UndefValue>(V1) && NotPoison(V2)) return V2; in ConstantFoldSelectInstruction()
602 if (isa<UndefValue>(V2) && NotPoison(V1)) return V1; in ConstantFoldSelectInstruction()
607 return ConstantExpr::getSelect(Cond, TrueVal->getOperand(1), V2); in ConstantFoldSelectInstruction()
609 if (ConstantExpr *FalseVal = dyn_cast<ConstantExpr>(V2)) { in ConstantFoldSelectInstruction()
716 Constant *llvm::ConstantFoldShuffleVectorInstruction(Constant *V1, Constant *V2, in ConstantFoldShuffleVectorInstruction() argument
757 Type *Ty = IntegerType::get(V2->getContext(), 32); in ConstantFoldShuffleVectorInstruction()
759 ConstantExpr::getExtractElement(V2, in ConstantFoldShuffleVectorInstruction()
1363 static FCmpInst::Predicate evaluateFCmpRelation(Constant *V1, Constant *V2) { in evaluateFCmpRelation() argument
1364 assert(V1->getType() == V2->getType() && in evaluateFCmpRelation()
1369 if (V1 == V2) return FCmpInst::FCMP_UEQ; in evaluateFCmpRelation()
1372 if (!isa<ConstantExpr>(V2)) { in evaluateFCmpRelation()
1376 ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ, V1, V2)); in evaluateFCmpRelation()
1380 ConstantExpr::getFCmp(FCmpInst::FCMP_OLT, V1, V2)); in evaluateFCmpRelation()
1384 ConstantExpr::getFCmp(FCmpInst::FCMP_OGT, V1, V2)); in evaluateFCmpRelation()
1393 FCmpInst::Predicate SwappedRelation = evaluateFCmpRelation(V2, V1); in evaluateFCmpRelation()
1452 static ICmpInst::Predicate evaluateICmpRelation(Constant *V1, Constant *V2, in evaluateICmpRelation() argument
1454 assert(V1->getType() == V2->getType() && in evaluateICmpRelation()
1456 if (V1 == V2) return ICmpInst::ICMP_EQ; in evaluateICmpRelation()
1460 if (!isa<GlobalValue>(V2) && !isa<ConstantExpr>(V2) && in evaluateICmpRelation()
1461 !isa<BlockAddress>(V2)) { in evaluateICmpRelation()
1466 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1470 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1474 R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, V1, V2)); in evaluateICmpRelation()
1484 evaluateICmpRelation(V2, V1, isSigned); in evaluateICmpRelation()
1489 if (isa<ConstantExpr>(V2)) { // Swap as necessary. in evaluateICmpRelation()
1491 evaluateICmpRelation(V2, V1, isSigned); in evaluateICmpRelation()
1500 if (const GlobalValue *GV2 = dyn_cast<GlobalValue>(V2)) { in evaluateICmpRelation()
1502 } else if (isa<BlockAddress>(V2)) { in evaluateICmpRelation()
1505 assert(isa<ConstantPointerNull>(V2) && "Canonicalization guarantee!"); in evaluateICmpRelation()
1517 if (isa<ConstantExpr>(V2)) { // Swap as necessary. in evaluateICmpRelation()
1519 evaluateICmpRelation(V2, V1, isSigned); in evaluateICmpRelation()
1528 if (const BlockAddress *BA2 = dyn_cast<BlockAddress>(V2)) { in evaluateICmpRelation()
1536 assert((isa<ConstantPointerNull>(V2) || isa<GlobalValue>(V2)) && in evaluateICmpRelation()
1558 if (const GlobalValue *GV2 = dyn_cast<GlobalValue>(V2)) in evaluateICmpRelation()
1571 if (V2->isNullValue() && CE1->getType()->isIntOrPtrTy()) { in evaluateICmpRelation()
1584 if (isa<ConstantPointerNull>(V2)) { in evaluateICmpRelation()
1603 } else if (const GlobalValue *GV2 = dyn_cast<GlobalValue>(V2)) { in evaluateICmpRelation()
1626 ConstantExpr *CE2 = cast<ConstantExpr>(V2); in evaluateICmpRelation()
1791 const APInt &V2 = cast<ConstantInt>(C2)->getValue(); in ConstantFoldCompareInstruction() local
1794 case ICmpInst::ICMP_EQ: return ConstantInt::get(ResultTy, V1 == V2); in ConstantFoldCompareInstruction()
1795 case ICmpInst::ICMP_NE: return ConstantInt::get(ResultTy, V1 != V2); in ConstantFoldCompareInstruction()
1796 case ICmpInst::ICMP_SLT: return ConstantInt::get(ResultTy, V1.slt(V2)); in ConstantFoldCompareInstruction()
1797 case ICmpInst::ICMP_SGT: return ConstantInt::get(ResultTy, V1.sgt(V2)); in ConstantFoldCompareInstruction()
1798 case ICmpInst::ICMP_SLE: return ConstantInt::get(ResultTy, V1.sle(V2)); in ConstantFoldCompareInstruction()
1799 case ICmpInst::ICMP_SGE: return ConstantInt::get(ResultTy, V1.sge(V2)); in ConstantFoldCompareInstruction()
1800 case ICmpInst::ICMP_ULT: return ConstantInt::get(ResultTy, V1.ult(V2)); in ConstantFoldCompareInstruction()
1801 case ICmpInst::ICMP_UGT: return ConstantInt::get(ResultTy, V1.ugt(V2)); in ConstantFoldCompareInstruction()
1802 case ICmpInst::ICMP_ULE: return ConstantInt::get(ResultTy, V1.ule(V2)); in ConstantFoldCompareInstruction()
1803 case ICmpInst::ICMP_UGE: return ConstantInt::get(ResultTy, V1.uge(V2)); in ConstantFoldCompareInstruction()