Lines Matching refs:C2

677                                               Constant *C2) {  in ConstantFoldBinaryInstruction()  argument
685 return C2; in ConstantFoldBinaryInstruction()
686 if (C2 == Identity) in ConstantFoldBinaryInstruction()
690 if (C2 == Identity) in ConstantFoldBinaryInstruction()
695 if (isa<PoisonValue>(C1) || isa<PoisonValue>(C2)) in ConstantFoldBinaryInstruction()
703 (isa<UndefValue>(C1) || isa<UndefValue>(C2)); in ConstantFoldBinaryInstruction()
707 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
716 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) // undef & undef -> undef in ConstantFoldBinaryInstruction()
721 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
725 if (match(C1, m_APInt(CV)) || match(C2, m_APInt(CV))) in ConstantFoldBinaryInstruction()
736 if (match(C2, m_CombineOr(m_Undef(), m_Zero()))) in ConstantFoldBinaryInstruction()
737 return PoisonValue::get(C2->getType()); in ConstantFoldBinaryInstruction()
744 if (match(C2, m_CombineOr(m_Undef(), m_Zero()))) in ConstantFoldBinaryInstruction()
745 return PoisonValue::get(C2->getType()); in ConstantFoldBinaryInstruction()
749 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) // undef | undef -> undef in ConstantFoldBinaryInstruction()
754 if (isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
755 return PoisonValue::get(C2->getType()); in ConstantFoldBinaryInstruction()
760 if (isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
761 return PoisonValue::get(C2->getType()); in ConstantFoldBinaryInstruction()
767 if (isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
768 return PoisonValue::get(C2->getType()); in ConstantFoldBinaryInstruction()
773 if (match(C1, m_NegZeroFP()) && isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
774 return C2; in ConstantFoldBinaryInstruction()
781 if (isa<UndefValue>(C1) && isa<UndefValue>(C2)) in ConstantFoldBinaryInstruction()
800 if (ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) { in ConstantFoldBinaryInstruction()
804 return C2; // X * 0 == 0 in ConstantFoldBinaryInstruction()
820 return C2; // X & 0 == 0 in ConstantFoldBinaryInstruction()
863 return C2; // X | -1 == -1 in ConstantFoldBinaryInstruction()
886 ? ConstantExpr::get(Opcode, C2, C1) in ConstantFoldBinaryInstruction()
887 : ConstantFoldBinaryInstruction(Opcode, C2, C1); in ConstantFoldBinaryInstruction()
891 if (ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) { in ConstantFoldBinaryInstruction()
954 if (ConstantFP *CFP2 = dyn_cast<ConstantFP>(C2)) { in ConstantFoldBinaryInstruction()
980 if (Constant *C2Splat = C2->getSplatValue()) { in ConstantFoldBinaryInstruction()
1001 Constant *RHS = ConstantExpr::getExtractElement(C2, ExtractIdx); in ConstantFoldBinaryInstruction()
1027 Constant *T = ConstantExpr::get(Opcode, CE1->getOperand(1), C2); in ConstantFoldBinaryInstruction()
1031 } else if (isa<ConstantExpr>(C2)) { in ConstantFoldBinaryInstruction()
1035 return ConstantFoldBinaryInstruction(Opcode, C2, C1); in ConstantFoldBinaryInstruction()
1043 return ConstantExpr::getXor(C1, C2); in ConstantFoldBinaryInstruction()
1210 Constant *C1, Constant *C2) { in ConstantFoldCompareInstruction() argument
1226 if (isa<PoisonValue>(C1) || isa<PoisonValue>(C2)) in ConstantFoldCompareInstruction()
1229 if (isa<UndefValue>(C1) || isa<UndefValue>(C2)) { in ConstantFoldCompareInstruction()
1234 if (ICmpInst::isEquality(Predicate) || (isIntegerPredicate && C1 == C2)) in ConstantFoldCompareInstruction()
1247 if (C2->isNullValue()) { in ConstantFoldCompareInstruction()
1262 if (isa<ConstantInt>(C2)) in ConstantFoldCompareInstruction()
1263 return ConstantExpr::getXor(C1, ConstantExpr::getNot(C2)); in ConstantFoldCompareInstruction()
1264 return ConstantExpr::getXor(ConstantExpr::getNot(C1), C2); in ConstantFoldCompareInstruction()
1266 return ConstantExpr::getXor(C1, C2); in ConstantFoldCompareInstruction()
1272 if (isa<ConstantInt>(C1) && isa<ConstantInt>(C2)) { in ConstantFoldCompareInstruction()
1274 const APInt &V2 = cast<ConstantInt>(C2)->getValue(); in ConstantFoldCompareInstruction()
1276 } else if (isa<ConstantFP>(C1) && isa<ConstantFP>(C2)) { in ConstantFoldCompareInstruction()
1278 const APFloat &C2V = cast<ConstantFP>(C2)->getValueAPF(); in ConstantFoldCompareInstruction()
1284 if (Constant *C2Splat = C2->getSplatValue()) in ConstantFoldCompareInstruction()
1304 ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1313 if (C1 == C2) { in ConstantFoldCompareInstruction()
1323 switch (evaluateICmpRelation(C1, C2)) { in ConstantFoldCompareInstruction()
1408 if ((!isa<ConstantExpr>(C1) && isa<ConstantExpr>(C2)) || in ConstantFoldCompareInstruction()
1409 (C1->isNullValue() && !C2->isNullValue())) { in ConstantFoldCompareInstruction()
1414 return ConstantExpr::getICmp(Predicate, C2, C1); in ConstantFoldCompareInstruction()