Lines Matching refs:C2
762 const APInt *C1 = nullptr, *C2 = nullptr; in checkForNegativeOperand() local
776 if (match(Y, m_Or(m_Value(Z), m_APInt(C2))) && (*C2 == ~(*C1))) { in checkForNegativeOperand()
779 } else if (match(Y, m_And(m_Value(Z), m_APInt(C2))) && (*C1 == *C2)) { in checkForNegativeOperand()
801 if (match(Y, m_And(m_Value(Z), m_APInt(C2))) && *C1 == (*C2 + 1)) { in checkForNegativeOperand()
802 Value *NewOr = Builder.CreateOr(Z, ~(*C2)); in checkForNegativeOperand()
820 const APInt *C1, *C2; in foldNoWrapAdd() local
822 match(Op0, m_ZExt(m_NUWAddLike(m_Value(X), m_APInt(C2)))) && in foldNoWrapAdd()
823 C1->isNegative() && C1->sge(-C2->sext(C1->getBitWidth()))) { in foldNoWrapAdd()
824 APInt NewC = *C2 + C1->trunc(C2->getBitWidth()); in foldNoWrapAdd()
923 const APInt *C2; in foldAddWithConstant() local
924 if (match(Op0, m_Or(m_Value(), m_APInt(C2))) && *C2 == -*C) in foldAddWithConstant()
925 return BinaryOperator::CreateXor(Op0, ConstantInt::get(Add.getType(), *C2)); in foldAddWithConstant()
940 if (match(Op0, m_ZExt(m_Xor(m_Value(X), m_APInt(C2)))) && in foldAddWithConstant()
941 C2->isMinSignedValue() && C2->sext(Ty->getScalarSizeInBits()) == *C) in foldAddWithConstant()
944 if (match(Op0, m_Xor(m_Value(X), m_APInt(C2)))) { in foldAddWithConstant()
946 if (C2->isSignMask()) in foldAddWithConstant()
947 return BinaryOperator::CreateAdd(X, ConstantInt::get(Ty, *C2 ^ *C)); in foldAddWithConstant()
951 if (C2->isMask()) { in foldAddWithConstant()
953 if ((*C2 | LHSKnown.Zero).isAllOnes()) in foldAddWithConstant()
954 return BinaryOperator::CreateSub(ConstantInt::get(Ty, *C2 + *C), X); in foldAddWithConstant()
961 if (Op0->hasOneUse() && *C2 == -(*C)) { in foldAddWithConstant()
966 else if (C2->isPowerOf2()) in foldAddWithConstant()
967 ShAmt = BitWidth - C2->logBase2() - 1; in foldAddWithConstant()
990 if (match(Op0, m_AShr(m_Shl(m_Value(X), m_APInt(C2)), m_APInt(C3))) && in foldAddWithConstant()
991 C2 == C3 && *C2 == Ty->getScalarSizeInBits() - 1) { in foldAddWithConstant()
1179 APInt C1, C2; in SimplifyAddWithRemainder() local
1182 if (!RHS->hasOneUse() || !MatchMul(RHS, Rem, C2)) in SimplifyAddWithRemainder()
1183 Rem = RHS, C2 = APInt(I.getType()->getScalarSizeInBits(), 1); in SimplifyAddWithRemainder()
1186 std::swap(C1, C2); in SimplifyAddWithRemainder()
1192 APInt NewC = C1 - C2 * C0; in SimplifyAddWithRemainder()
1197 Value *MulXC2 = Builder.CreateMul(X, ConstantInt::get(X->getType(), C2)); in SimplifyAddWithRemainder()
1575 Constant *C1, *C2; in visitAdd() local
1577 m_Sub(m_ImmConstant(C2), m_Value(B)))) && in visitAdd()
1580 return BinaryOperator::CreateAdd(Sub, ConstantExpr::getAdd(C1, C2)); in visitAdd()
1596 const APInt *C1, *C2; in visitAdd() local
1597 if (match(LHS, m_Shl(m_SDiv(m_Specific(RHS), m_APInt(C1)), m_APInt(C2)))) { in visitAdd()
1598 APInt one(C2->getBitWidth(), 1); in visitAdd()
1600 if (minusC1 == (one << *C2)) { in visitAdd()
2151 Constant *C2; in visitSub() local
2154 if (match(Op1, m_Add(m_Value(X), m_ImmConstant(C2)))) { in visitSub()
2157 bool WillNotSOV = willNotOverflowSignedSub(C, C2, I); in visitSub()
2159 BinaryOperator::CreateSub(ConstantExpr::getSub(C, C2), X); in visitSub()
2318 Constant *C2; in visitSub() local
2321 if (match(Op1, m_Sub(m_ImmConstant(C2), m_Value(X)))) in visitSub()
2322 return BinaryOperator::CreateAdd(X, ConstantExpr::getSub(C, C2)); in visitSub()
2341 const APInt *C2, *C3; in visitSub() local
2343 if (match(Op1, m_OneUse(m_And(m_BinOp(InnerSub), m_APInt(C2)))) && in visitSub()
2345 (InnerSub->hasNoUnsignedWrap() || C2->isNegatedPowerOf2())) { in visitSub()
2346 APInt C2AndC3 = *C2 & *C3; in visitSub()
2348 APInt C2AddC3 = *C2 + *C3; in visitSub()
2351 Value *And = Builder.CreateAnd(X, ConstantInt::get(I.getType(), *C2)); in visitSub()