Lines Matching refs:C2

777   const APInt *C1 = nullptr, *C2 = nullptr;  in checkForNegativeOperand()  local
791 if (match(Y, m_Or(m_Value(Z), m_APInt(C2))) && (*C2 == ~(*C1))) { in checkForNegativeOperand()
794 } else if (match(Y, m_And(m_Value(Z), m_APInt(C2))) && (*C1 == *C2)) { in checkForNegativeOperand()
816 if (match(Y, m_And(m_Value(Z), m_APInt(C2))) && *C1 == (*C2 + 1)) { in checkForNegativeOperand()
817 Value *NewOr = Builder.CreateOr(Z, ~(*C2)); in checkForNegativeOperand()
835 const APInt *C1, *C2; in foldNoWrapAdd() local
837 match(Op0, m_OneUse(m_ZExt(m_NUWAdd(m_Value(X), m_APInt(C2))))) && in foldNoWrapAdd()
838 C1->isNegative() && C1->sge(-C2->sext(C1->getBitWidth()))) { in foldNoWrapAdd()
840 ConstantInt::get(X->getType(), *C2 + C1->trunc(C2->getBitWidth())); in foldNoWrapAdd()
911 const APInt *C2; in foldAddWithConstant() local
912 if (match(Op0, m_Or(m_Value(), m_APInt(C2))) && *C2 == -*C) in foldAddWithConstant()
913 return BinaryOperator::CreateXor(Op0, ConstantInt::get(Add.getType(), *C2)); in foldAddWithConstant()
929 if (match(Op0, m_ZExt(m_Xor(m_Value(X), m_APInt(C2)))) && in foldAddWithConstant()
930 C2->isMinSignedValue() && C2->sext(Ty->getScalarSizeInBits()) == *C) in foldAddWithConstant()
933 if (match(Op0, m_Xor(m_Value(X), m_APInt(C2)))) { in foldAddWithConstant()
935 if (C2->isSignMask()) in foldAddWithConstant()
936 return BinaryOperator::CreateAdd(X, ConstantInt::get(Ty, *C2 ^ *C)); in foldAddWithConstant()
940 if (C2->isMask()) { in foldAddWithConstant()
942 if ((*C2 | LHSKnown.Zero).isAllOnesValue()) in foldAddWithConstant()
943 return BinaryOperator::CreateSub(ConstantInt::get(Ty, *C2 + *C), X); in foldAddWithConstant()
950 if (Op0->hasOneUse() && *C2 == -(*C)) { in foldAddWithConstant()
955 else if (C2->isPowerOf2()) in foldAddWithConstant()
956 ShAmt = BitWidth - C2->logBase2() - 1; in foldAddWithConstant()
979 if (match(Op0, m_AShr(m_Shl(m_Value(X), m_APInt(C2)), m_APInt(C3))) && in foldAddWithConstant()
980 C2 == C3 && *C2 == Ty->getScalarSizeInBits() - 1) { in foldAddWithConstant()
989 if (match(Op0, m_OneUse(m_And(m_Value(X), m_APInt(C2)))) && in foldAddWithConstant()
990 C2->isNegative() && C2->isShiftedMask() && *C == (*C & *C2)) { in foldAddWithConstant()
992 return BinaryOperator::CreateAnd(NewAdd, ConstantInt::get(Ty, *C2)); in foldAddWithConstant()
1362 const APInt *C1, *C2; in visitAdd() local
1363 if (match(LHS, m_Shl(m_SDiv(m_Specific(RHS), m_APInt(C1)), m_APInt(C2)))) { in visitAdd()
1364 APInt one(C2->getBitWidth(), 1); in visitAdd()
1366 if (minusC1 == (one << *C2)) { in visitAdd()
1767 Constant *C2; in visitSub() local
1770 if (match(Op1, m_Add(m_Value(X), m_ImmConstant(C2)))) in visitSub()
1771 return BinaryOperator::CreateSub(ConstantExpr::getSub(C, C2), X); in visitSub()
1883 Constant *C2; in visitSub() local
1886 if (match(Op1, m_Sub(m_ImmConstant(C2), m_Value(X)))) in visitSub()
1887 return BinaryOperator::CreateAdd(X, ConstantExpr::getSub(C, C2)); in visitSub()