Lines Matching refs:C2

920                                               Constant *C2) {  in ConstantFoldBinaryInstruction()  argument
925 (isa<UndefValue>(C1) || isa<UndefValue>(C2)); in ConstantFoldBinaryInstruction()
929 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
938 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) // undef & undef -> undef in ConstantFoldBinaryInstruction()
943 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
947 if (match(C1, m_APInt(CV)) || match(C2, m_APInt(CV))) in ConstantFoldBinaryInstruction()
957 if (isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
958 return C2; in ConstantFoldBinaryInstruction()
961 if (match(C2, m_Zero()) || match(C2, m_One())) in ConstantFoldBinaryInstruction()
968 if (match(C2, m_Undef())) in ConstantFoldBinaryInstruction()
969 return C2; in ConstantFoldBinaryInstruction()
971 if (match(C2, m_Zero())) in ConstantFoldBinaryInstruction()
976 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) // undef | undef -> undef in ConstantFoldBinaryInstruction()
981 if (isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
982 return C2; in ConstantFoldBinaryInstruction()
984 if (match(C2, m_Zero())) in ConstantFoldBinaryInstruction()
990 if (isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
991 return C2; in ConstantFoldBinaryInstruction()
993 if (match(C2, m_Zero())) in ConstantFoldBinaryInstruction()
1000 if (isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
1001 return C2; in ConstantFoldBinaryInstruction()
1003 if (match(C2, m_Zero())) in ConstantFoldBinaryInstruction()
1013 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
1032 if (ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) { in ConstantFoldBinaryInstruction()
1041 if (CI2->isZero()) return C2; // X * 0 == 0 in ConstantFoldBinaryInstruction()
1060 if (CI2->isZero()) return C2; // X & 0 == 0 in ConstantFoldBinaryInstruction()
1100 return C2; // X | -1 == -1 in ConstantFoldBinaryInstruction()
1123 return ConstantExpr::getLShr(C1, C2); in ConstantFoldBinaryInstruction()
1129 return ConstantExpr::get(Opcode, C2, C1); in ConstantFoldBinaryInstruction()
1133 if (ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) { in ConstantFoldBinaryInstruction()
1196 if (ConstantFP *CFP2 = dyn_cast<ConstantFP>(C2)) { in ConstantFoldBinaryInstruction()
1227 Constant *RHS = ConstantExpr::getExtractElement(C2, ExtractIdx); in ConstantFoldBinaryInstruction()
1247 Constant *T = ConstantExpr::get(Opcode, CE1->getOperand(1), C2); in ConstantFoldBinaryInstruction()
1251 } else if (isa<ConstantExpr>(C2)) { in ConstantFoldBinaryInstruction()
1255 return ConstantFoldBinaryInstruction(Opcode, C2, C1); in ConstantFoldBinaryInstruction()
1263 return ConstantExpr::getXor(C1, C2); in ConstantFoldBinaryInstruction()
1265 return ConstantExpr::getAnd(C1, C2); in ConstantFoldBinaryInstruction()
1315 static int IdxCompare(Constant *C1, Constant *C2, Type *ElTy) { in IdxCompare() argument
1316 if (C1 == C2) return 0; in IdxCompare()
1320 if (!isa<ConstantInt>(C1) || !isa<ConstantInt>(C2)) in IdxCompare()
1325 cast<ConstantInt>(C2)->getValue().getActiveBits() > 64) in IdxCompare()
1331 int64_t C2Val = cast<ConstantInt>(C2)->getSExtValue(); in IdxCompare()
1698 Constant *C1, Constant *C2) { in ConstantFoldCompareInstruction() argument
1714 if (isa<UndefValue>(C1) || isa<UndefValue>(C2)) { in ConstantFoldCompareInstruction()
1720 if (ICmpInst::isEquality(Predicate) || (isIntegerPredicate && C1 == C2)) in ConstantFoldCompareInstruction()
1735 if (const GlobalValue *GV = dyn_cast<GlobalValue>(C2)) in ConstantFoldCompareInstruction()
1746 } else if (C2->isNullValue()) { in ConstantFoldCompareInstruction()
1763 if (isa<ConstantInt>(C2)) in ConstantFoldCompareInstruction()
1764 return ConstantExpr::getXor(C1, ConstantExpr::getNot(C2)); in ConstantFoldCompareInstruction()
1765 return ConstantExpr::getXor(ConstantExpr::getNot(C1), C2); in ConstantFoldCompareInstruction()
1767 return ConstantExpr::getXor(C1, C2); in ConstantFoldCompareInstruction()
1773 if (isa<ConstantInt>(C1) && isa<ConstantInt>(C2)) { in ConstantFoldCompareInstruction()
1775 const APInt &V2 = cast<ConstantInt>(C2)->getValue(); in ConstantFoldCompareInstruction()
1789 } else if (isa<ConstantFP>(C1) && isa<ConstantFP>(C2)) { in ConstantFoldCompareInstruction()
1791 const APFloat &C2V = cast<ConstantFP>(C2)->getValueAPF(); in ConstantFoldCompareInstruction()
1842 ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, i)); in ConstantFoldCompareInstruction()
1853 (isa<ConstantExpr>(C1) || isa<ConstantExpr>(C2))) { in ConstantFoldCompareInstruction()
1855 switch (evaluateFCmpRelation(C1, C2)) { in ConstantFoldCompareInstruction()
1914 switch (evaluateICmpRelation(C1, C2, in ConstantFoldCompareInstruction()
1985 if (ConstantExpr *CE2 = dyn_cast<ConstantExpr>(C2)) { in ConstantFoldCompareInstruction()
2004 Constant *C2Inverse = ConstantExpr::getTrunc(C2, CE1Op0->getType()); in ConstantFoldCompareInstruction()
2006 C2->getType()) == C2) in ConstantFoldCompareInstruction()
2012 if ((!isa<ConstantExpr>(C1) && isa<ConstantExpr>(C2)) || in ConstantFoldCompareInstruction()
2013 (C1->isNullValue() && !C2->isNullValue())) { in ConstantFoldCompareInstruction()
2018 return ConstantExpr::getICmp(pred, C2, C1); in ConstantFoldCompareInstruction()
2180 Constant *C2 = ConstantExpr::getSExtOrBitCast(Combined, CommonTy); in ConstantFoldGetElementPtr() local
2181 Combined = ConstantExpr::get(Instruction::Add, C1, C2); in ConstantFoldGetElementPtr()