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_OneUse(m_ZExt(m_NUWAdd(m_Value(X), m_APInt(C2))))) && in foldNoWrapAdd()
823 C1->isNegative() && C1->sge(-C2->sext(C1->getBitWidth()))) { in foldNoWrapAdd()
825 ConstantInt::get(X->getType(), *C2 + C1->trunc(C2->getBitWidth())); in foldNoWrapAdd()
910 const APInt *C2; in foldAddWithConstant() local
911 if (match(Op0, m_Or(m_Value(), m_APInt(C2))) && *C2 == -*C) in foldAddWithConstant()
912 return BinaryOperator::CreateXor(Op0, ConstantInt::get(Add.getType(), *C2)); in foldAddWithConstant()
927 if (match(Op0, m_ZExt(m_Xor(m_Value(X), m_APInt(C2)))) && in foldAddWithConstant()
928 C2->isMinSignedValue() && C2->sext(Ty->getScalarSizeInBits()) == *C) in foldAddWithConstant()
931 if (match(Op0, m_Xor(m_Value(X), m_APInt(C2)))) { in foldAddWithConstant()
933 if (C2->isSignMask()) in foldAddWithConstant()
934 return BinaryOperator::CreateAdd(X, ConstantInt::get(Ty, *C2 ^ *C)); in foldAddWithConstant()
938 if (C2->isMask()) { in foldAddWithConstant()
940 if ((*C2 | LHSKnown.Zero).isAllOnes()) in foldAddWithConstant()
941 return BinaryOperator::CreateSub(ConstantInt::get(Ty, *C2 + *C), X); in foldAddWithConstant()
948 if (Op0->hasOneUse() && *C2 == -(*C)) { in foldAddWithConstant()
953 else if (C2->isPowerOf2()) in foldAddWithConstant()
954 ShAmt = BitWidth - C2->logBase2() - 1; in foldAddWithConstant()
977 if (match(Op0, m_AShr(m_Shl(m_Value(X), m_APInt(C2)), m_APInt(C3))) && in foldAddWithConstant()
978 C2 == C3 && *C2 == Ty->getScalarSizeInBits() - 1) { in foldAddWithConstant()
1533 Constant *C1, *C2; in visitAdd() local
1535 m_Sub(m_ImmConstant(C2), m_Value(B)))) && in visitAdd()
1538 return BinaryOperator::CreateAdd(Sub, ConstantExpr::getAdd(C1, C2)); in visitAdd()
1554 const APInt *C1, *C2; in visitAdd() local
1555 if (match(LHS, m_Shl(m_SDiv(m_Specific(RHS), m_APInt(C1)), m_APInt(C2)))) { in visitAdd()
1556 APInt one(C2->getBitWidth(), 1); in visitAdd()
1558 if (minusC1 == (one << *C2)) { in visitAdd()
2158 Constant *C2; in visitSub() local
2161 if (match(Op1, m_Add(m_Value(X), m_ImmConstant(C2)))) { in visitSub()
2164 bool WillNotSOV = willNotOverflowSignedSub(C, C2, I); in visitSub()
2166 BinaryOperator::CreateSub(ConstantExpr::getSub(C, C2), X); in visitSub()
2325 Constant *C2; in visitSub() local
2328 if (match(Op1, m_Sub(m_ImmConstant(C2), m_Value(X)))) in visitSub()
2329 return BinaryOperator::CreateAdd(X, ConstantExpr::getSub(C, C2)); in visitSub()
2346 const APInt *C2, *C3; in visitSub() local
2348 if (match(Op1, m_OneUse(m_And(m_BinOp(InnerSub), m_APInt(C2)))) && in visitSub()
2350 (InnerSub->hasNoUnsignedWrap() || C2->isNegatedPowerOf2())) { in visitSub()
2351 APInt C2AndC3 = *C2 & *C3; in visitSub()
2353 APInt C2AddC3 = *C2 + *C3; in visitSub()
2356 Value *And = Builder.CreateAnd(X, ConstantInt::get(I.getType(), *C2)); in visitSub()