Lines Matching refs:Op1

811   Value *Op0 = Add.getOperand(0), *Op1 = Add.getOperand(1);  in foldNoWrapAdd()  local
814 if (!match(Op1, m_Constant(Op1C))) in foldNoWrapAdd()
821 if (match(Op1, m_APInt(C1)) && in foldNoWrapAdd()
857 Value *Op0 = Add.getOperand(0), *Op1 = Add.getOperand(1); in foldAddWithConstant() local
860 if (!match(Op1, m_ImmConstant(Op1C))) in foldAddWithConstant()
877 match(Op1, m_AllOnes())) in foldAddWithConstant()
883 return SelectInst::Create(X, InstCombiner::AddOne(Op1C), Op1); in foldAddWithConstant()
887 return SelectInst::Create(X, InstCombiner::SubOne(Op1C), Op1); in foldAddWithConstant()
905 match(Op1, m_One())) in foldAddWithConstant()
908 if (!match(Op1, m_APInt(C))) in foldAddWithConstant()
931 return BinaryOperator::CreateOr(Op0, Op1); in foldAddWithConstant()
935 return BinaryOperator::CreateXor(Op0, Op1); in foldAddWithConstant()
1418 auto *Op1 = dyn_cast<BinaryOperator>(I.getOperand(1)); in factorizeMathWithShlOps() local
1419 if (!Op0 || !Op1 || !(Op0->hasOneUse() || Op1->hasOneUse())) in factorizeMathWithShlOps()
1424 !match(Op1, m_Shl(m_Value(Y), m_Specific(ShAmt)))) in factorizeMathWithShlOps()
1429 Op1->hasNoSignedWrap(); in factorizeMathWithShlOps()
1431 Op1->hasNoUnsignedWrap(); in factorizeMathWithShlOps()
1852 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in factorizeFAddFSub() local
1853 if (!Op0->hasOneUse() || !Op1->hasOneUse()) in factorizeFAddFSub()
1859 match(Op1, m_c_FMul(m_Value(Y), m_Specific(Z)))) || in factorizeFAddFSub()
1861 match(Op1, m_c_FMul(m_Value(Y), m_Specific(Z))))) in factorizeFAddFSub()
1864 match(Op1, m_FDiv(m_Value(Y), m_Specific(Z)))) in factorizeFAddFSub()
2069 Value *Op1 = I.getOperand(1); in foldSubOfMinMax() local
2071 auto *MinMax = dyn_cast<MinMaxIntrinsic>(Op1); in foldSubOfMinMax()
2080 (Op0->hasOneUse() || Op1->hasOneUse())) { in foldSubOfMinMax()
2089 if (match(Op1, m_OneUse(m_UMin(m_Value(Y), m_Value(Z))))) { in foldSubOfMinMax()
2124 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitSub() local
2128 if (Value *V = dyn_castNegVal(Op1)) { in visitSub()
2131 if (const auto *BO = dyn_cast<BinaryOperator>(Op1)) { in visitSub()
2137 if (cast<Constant>(Op1)->isNotMinSignedValue() && I.hasNoSignedWrap()) in visitSub()
2154 if (match(Op1, m_Add(m_Value(X), m_ImmConstant(C2)))) { in visitSub()
2160 auto *OBO1 = cast<OverflowingBinaryOperator>(Op1); in visitSub()
2169 auto TryToNarrowDeduceFlags = [this, &I, &Op0, &Op1]() -> Instruction * { in visitSub()
2174 if (!I.hasNoSignedWrap() && willNotOverflowSignedSub(Op0, Op1, I)) { in visitSub()
2178 if (!I.hasNoUnsignedWrap() && willNotOverflowUnsignedSub(Op0, Op1, I)) { in visitSub()
2190 if (!IsNegation || none_of(I.users(), [&I, Op1](const User *U) { in visitSub()
2195 m_Select(m_Value(), m_Specific(Op1), m_Specific(&I))) || in visitSub()
2196 match(UI, m_Select(m_Value(), m_Specific(&I), m_Specific(Op1))); in visitSub()
2200 Op1, *this)) in visitSub()
2211 return BinaryOperator::CreateXor(Op0, Op1); in visitSub()
2215 return BinaryOperator::CreateNot(Op1); in visitSub()
2220 return BinaryOperator::CreateAdd(Builder.CreateNot(Op1), X); in visitSub()
2229 Value *YW = Builder.CreateAdd(Y, Op1); in visitSub()
2238 Value *Add = Builder.CreateAdd(Y, Op1, "", /* HasNUW */ HasNUW, in visitSub()
2252 match(Op1, m_c_Add(m_Value(Y), m_Specific(Z)))) in visitSub()
2258 match(Op1, m_OneUse(m_Add(m_Value(Y), m_ImmConstant(CY))))) { in visitSub()
2271 isFreeToInvert(Op1, Op1->hasOneUse(), ConsumesOp1) && in visitSub()
2274 Value *NotOp1 = getFreelyInverted(Op1, Op1->hasOneUse(), &Builder); in visitSub()
2285 if (match(Op0, m_AddRdx(V0)) && match(Op1, m_AddRdx(V1)) && in visitSub()
2297 if (match(Op1, m_ZExt(m_Value(X))) && X->getType()->isIntOrIntVectorTy(1)) in visitSub()
2300 if (match(Op1, m_SExt(m_Value(X))) && X->getType()->isIntOrIntVectorTy(1)) in visitSub()
2305 if (match(Op1, m_Not(m_Value(X)))) in visitSub()
2309 if (SelectInst *SI = dyn_cast<SelectInst>(Op1)) in visitSub()
2314 if (PHINode *PN = dyn_cast<PHINode>(Op1)) in visitSub()
2321 if (match(Op1, m_Sub(m_ImmConstant(C2), m_Value(X)))) in visitSub()
2332 Op1, 0, SQ.getWithInstruction(&I).getWithoutDomCondCache()); in visitSub()
2334 return BinaryOperator::CreateXor(Op1, Op0); in visitSub()
2343 if (match(Op1, m_OneUse(m_And(m_BinOp(InnerSub), m_APInt(C2)))) && in visitSub()
2361 if (match(Op1, m_c_Add(m_Specific(Op0), m_Value(Y)))) in visitSub()
2365 if (match(Op0, m_Sub(m_Specific(Op1), m_Value(Y)))) in visitSub()
2372 if (match(Op1, m_And(m_Value(A), m_Value(B))) && in visitSub()
2381 match(Op1, m_c_Or(m_Specific(A), m_Specific(B)))) in visitSub()
2389 match(Op1, m_c_And(m_Specific(A), m_Specific(B)))) in visitSub()
2397 match(Op1, m_c_Or(m_Specific(A), m_Specific(B))) && in visitSub()
2398 (Op0->hasOneUse() || Op1->hasOneUse())) in visitSub()
2405 if (match(Op1, m_Xor(m_Value(A), m_Value(B))) && in visitSub()
2414 match(Op1, m_c_Or(m_Specific(A), m_Specific(B))) && in visitSub()
2415 (Op0->hasOneUse() || Op1->hasOneUse())) in visitSub()
2422 if (match(Op0, m_OneUse(m_c_Or(m_Value(Y), m_Specific(Op1))))) in visitSub()
2424 Y, Builder.CreateNot(Op1, Op1->getName() + ".not")); in visitSub()
2430 if (match(Op0, m_OneUse(m_c_And(m_Specific(Op1), in visitSub()
2433 Op1, Builder.CreateAdd(X, Constant::getAllOnesValue(I.getType())))); in visitSub()
2440 if (match(Op0, m_OneUse(m_And(m_Specific(Op1), m_Constant(C))))) { in visitSub()
2442 Builder.CreateAnd(Op1, Builder.CreateNot(C))); in visitSub()
2455 if (m_SubXorCmp(Op0, Op1)) in visitSub()
2457 if (m_SubXorCmp(Op1, Op0)) in visitSub()
2501 /*Select=*/Op0, /*OtherHandOfSub=*/Op1, in visitSub()
2502 [Builder = &Builder, Op1](Value *OtherHandOfSelect) { in visitSub()
2504 /*OtherHandOfSub=*/Op1); in visitSub()
2508 /*Select=*/Op1, /*OtherHandOfSub=*/Op0, in visitSub()
2517 if (match(Op1, m_c_And(m_Specific(Op0), m_Value(Y))) && in visitSub()
2518 (Op1->hasOneUse() || isa<Constant>(Y))) in visitSub()
2530 match(Op1, m_c_MaxOrMin(m_Specific(Op0), m_Value(Y))) && in visitSub()
2532 Value *Not = Builder.CreateNot(Op1); in visitSub()
2535 if (match(Op1, m_Not(m_Value(X))) && in visitSub()
2536 match(Op0, m_c_MaxOrMin(m_Specific(Op1), m_Value(Y))) && in visitSub()
2537 !Op1->hasNUsesOrMore(3) && isFreeToInvert(Y, Y->hasOneUse())) { in visitSub()
2546 match(Op1, m_PtrToInt(m_Value(RHSOp)))) in visitSub()
2553 match(Op1, m_Trunc(m_PtrToInt(m_Value(RHSOp))))) in visitSub()
2567 if (match(Op1, m_AShr(m_Value(A), m_APInt(ShAmt))) && in visitSub()
2568 Op1->hasNUses(2) && *ShAmt == BitWidth - 1 && in visitSub()
2569 match(Op0, m_OneUse(m_c_Xor(m_Specific(A), m_Specific(Op1))))) { in visitSub()
2587 match(Op1, m_And(m_Specific(X), m_APInt(AndC)))) { in visitSub()
2599 if (match(Op1, m_OneUse(m_Intrinsic<Intrinsic::usub_sat>(m_Specific(Op0), in visitSub()
2607 if (match(Op0, m_OneUse(m_c_UMax(m_Value(X), m_Specific(Op1))))) in visitSub()
2609 I, Builder.CreateIntrinsic(Intrinsic::usub_sat, {Ty}, {X, Op1})); in visitSub()
2612 if (match(Op1, m_OneUse(m_c_UMin(m_Value(X), m_Specific(Op0))))) in visitSub()
2617 if (match(Op1, m_OneUse(m_c_UMax(m_Value(X), m_Specific(Op0))))) { in visitSub()
2623 if (match(Op0, m_OneUse(m_c_UMin(m_Value(X), m_Specific(Op1))))) { in visitSub()
2624 Value *USub = Builder.CreateIntrinsic(Intrinsic::usub_sat, {Ty}, {Op1, X}); in visitSub()
2630 match(Op1, m_OneUse(m_Intrinsic<Intrinsic::ctpop>(m_Value(X))))) in visitSub()
2638 match(Op1, m_OneUse(m_Mul(m_Value(Y), m_Deferred(Y))))) { in visitSub()
2640 auto *OBO1 = cast<OverflowingBinaryOperator>(Op1); in visitSub()
2653 match(Op1, m_OneUse(m_c_SMin(m_Specific(X), m_Specific(Y))))) { in visitSub()
2862 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitFSub() local
2871 if (match(Op1, m_OneUse(m_FSub(m_Value(X), m_Value(Y))))) { in visitFSub()
2880 Value *FAdd = Builder.CreateFAddFMF(X, Op1, &I); in visitFSub()
2885 if (SelectInst *SI = dyn_cast<SelectInst>(Op1)) in visitFSub()
2892 if (match(Op1, m_ImmConstant(C))) in visitFSub()
2897 if (match(Op1, m_FNeg(m_Value(Y)))) in visitFSub()
2903 if (match(Op1, m_OneUse(m_FPTrunc(m_FNeg(m_Value(Y)))))) in visitFSub()
2907 if (match(Op1, m_OneUse(m_FPExt(m_FNeg(m_Value(Y)))))) in visitFSub()
2913 if (match(Op1, m_OneUse(m_c_FMul(m_FNeg(m_Value(X)), m_Value(Y))))) { in visitFSub()
2919 if (match(Op1, m_OneUse(m_FDiv(m_FNeg(m_Value(X)), m_Value(Y)))) || in visitFSub()
2920 match(Op1, m_OneUse(m_FDiv(m_Value(X), m_FNeg(m_Value(Y)))))) { in visitFSub()
2926 if (Value *V = SimplifySelectsFeedingBinaryOp(I, Op0, Op1)) in visitFSub()
2931 if (match(Op0, m_FSub(m_Specific(Op1), m_Value(X)))) in visitFSub()
2936 if (match(Op1, m_c_FAdd(m_Specific(Op0), m_Value(X)))) in visitFSub()
2940 if (match(Op0, m_FMul(m_Specific(Op1), m_Constant(C)))) { in visitFSub()
2943 return BinaryOperator::CreateFMulFMF(Op1, CSubOne, &I); in visitFSub()
2946 if (match(Op1, m_FMul(m_Specific(Op0), m_Constant(C)))) { in visitFSub()
2959 Value *YW = Builder.CreateFAddFMF(Y, Op1, &I); in visitFSub()
2968 if (match(Op0, m_FaddRdx(A0, V0)) && match(Op1, m_FaddRdx(A1, V1)) && in visitFSub()
2990 Value *FAdd = Builder.CreateFAddFMF(Y, Op1, &I); in visitFSub()