Lines Matching refs:Op1

196   Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);  in visitMul()  local
198 simplifyMulInst(Op0, Op1, I.hasNoSignedWrap(), I.hasNoUnsignedWrap(), in visitMul()
220 if (match(Op1, m_AllOnes())) { in visitMul()
264 if (Op0->hasOneUse() && match(Op1, m_NegatedPower2())) { in visitMul()
269 auto *Op1C = cast<Constant>(Op1); in visitMul()
285 match(Op1, m_APIntAllowPoison(NegPow2C))) { in visitMul()
304 if (match(Op1, m_ImmConstant(MulC))) { in visitMul()
329 if (Op0 == Op1 && match(Op0, m_Intrinsic<Intrinsic::abs>(m_Value(X)))) in visitMul()
338 match(Op1, m_OneUse(m_Intrinsic<Intrinsic::abs>(m_Value(Y), m_One())))) in visitMul()
348 if (match(Op0, m_Neg(m_Value(X))) && match(Op1, m_Constant(Op1C))) in visitMul()
352 if (match(Op0, m_Neg(m_Value(X))) && match(Op1, m_Neg(m_Value(Y)))) { in visitMul()
355 cast<OverflowingBinaryOperator>(Op1)->hasNoSignedWrap()) in visitMul()
367 if (match(Op1, m_Neg(m_Value(X)))) { in visitMul()
383 if (match(Op1, m_APInt(C1)) && in visitMul()
390 Op1)); in visitMul()
397 Value *Y = Op1; in visitMul()
402 Div = dyn_cast<BinaryOperator>(Op1); in visitMul()
438 match(Op1, m_And(m_Value(), m_One())))) in visitMul()
439 return BinaryOperator::CreateAnd(Op0, Op1); in visitMul()
449 if (((match(Op0, m_ZExt(m_Value(X))) && match(Op1, m_ZExt(m_Value(Y)))) || in visitMul()
450 (match(Op0, m_SExt(m_Value(X))) && match(Op1, m_SExt(m_Value(Y))))) && in visitMul()
452 (Op0->hasOneUse() || Op1->hasOneUse() || X == Y)) { in visitMul()
459 if (((match(Op0, m_SExt(m_Value(X))) && match(Op1, m_ZExt(m_Value(Y)))) || in visitMul()
460 (match(Op0, m_ZExt(m_Value(X))) && match(Op1, m_SExt(m_Value(Y))))) && in visitMul()
462 (Op0->hasOneUse() || Op1->hasOneUse())) { in visitMul()
470 return SelectInst::Create(X, Op1, ConstantInt::getNullValue(Ty)); in visitMul()
471 if (match(Op1, m_ZExt(m_Value(X))) && X->getType()->isIntOrIntVectorTy(1)) in visitMul()
482 if (match(Op1, m_ImmConstant(ImmC))) { in visitMul()
542 BinaryOperator *Shl = BinaryOperator::CreateShl(Op1, Res); in visitMul()
547 if (takeLog2(Builder, Op1, /*Depth*/ 0, /*AssumeNonZero*/ false, in visitMul()
549 Value *Res = takeLog2(Builder, Op1, /*Depth*/ 0, /*AssumeNonZero*/ false, in visitMul()
558 if (!HasNSW && willNotOverflowSignedMul(Op0, Op1, I)) { in visitMul()
563 if (!HasNUW && willNotOverflowUnsignedMul(Op0, Op1, I, I.hasNoSignedWrap())) { in visitMul()
576 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in foldFPSignBitOps() local
581 if (match(Op0, m_FNeg(m_Value(X))) && match(Op1, m_FNeg(m_Value(Y)))) in foldFPSignBitOps()
586 if (Op0 == Op1 && match(Op0, m_FAbs(m_Value(X)))) in foldFPSignBitOps()
591 if (match(Op0, m_FAbs(m_Value(X))) && match(Op1, m_FAbs(m_Value(Y))) && in foldFPSignBitOps()
592 (Op0->hasOneUse() || Op1->hasOneUse())) { in foldFPSignBitOps()
634 Value *Op1 = I.getOperand(1); in foldPowiReassoc() local
638 match(Op1, m_AllowReassoc(m_Intrinsic<Intrinsic::powi>(m_Specific(X), in foldPowiReassoc()
651 m_Specific(Op1), m_Value(Y))))) && in foldPowiReassoc()
654 Instruction *NewPow = createPowiExpr(I, *this, Op1, Y, NegOne); in foldPowiReassoc()
664 match(Op1, m_AllowReassoc(m_c_FMul(m_Specific(X), m_Value(Z)))) && in foldPowiReassoc()
677 Value *Op1 = I.getOperand(1); in foldFMulReassoc() local
684 if (match(Op1, m_Constant(C)) && C->isFiniteNonZeroFP() && in foldFMulReassoc()
739 BinaryOperator *DivOp = cast<BinaryOperator>(((Z == Op0) ? Op1 : Op0)); in foldFMulReassoc()
754 match(Op1, m_OneUse(m_Sqrt(m_Value(Y))))) { in foldFMulReassoc()
768 match(Y, m_Sqrt(m_Value(X))) && Op1 == X) in foldFMulReassoc()
771 match(Op1, (m_FDiv(m_SpecificFP(1.0), m_Value(Y)))) && in foldFMulReassoc()
777 if (I.hasNoNaNs() && I.hasNoSignedZeros() && Op0 == Op1 && Op0->hasNUses(2)) { in foldFMulReassoc()
807 match(Op1, m_Intrinsic<Intrinsic::pow>(m_Specific(X), m_Value(Z)))) { in foldFMulReassoc()
814 match(Op1, m_Intrinsic<Intrinsic::pow>(m_Value(Z), m_Specific(Y)))) { in foldFMulReassoc()
822 match(Op1, m_Intrinsic<Intrinsic::exp>(m_Value(Y)))) { in foldFMulReassoc()
830 match(Op1, m_Intrinsic<Intrinsic::exp2>(m_Value(Y)))) { in foldFMulReassoc()
844 if (match(Op0, m_OneUse(m_c_FMul(m_Specific(Op1), m_Value(Y)))) && Op1 != Y) { in foldFMulReassoc()
845 Value *XX = Builder.CreateFMulFMF(Op1, Op1, &I); in foldFMulReassoc()
848 if (match(Op1, m_OneUse(m_c_FMul(m_Specific(Op0), m_Value(Y)))) && Op0 != Y) { in foldFMulReassoc()
884 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitFMul() local
885 if (match(Op1, m_SpecificFP(-1.0))) in visitFMul()
892 if (match(Op1, m_APFloatAllowPoison(FPC)) && FPC->isZero() && in visitFMul()
899 {I.getType()}, {Op1, Op0}, &I); in visitFMul()
906 if (match(Op0, m_FNeg(m_Value(X))) && match(Op1, m_Constant(C))) in visitFMul()
916 auto *SI = SelectInst::Create(X, Op1, ConstantFP::get(I.getType(), 0.0)); in visitFMul()
920 if (match(Op1, m_UIToFP(m_Value(X))) && in visitFMul()
929 if (Value *V = SimplifySelectsFeedingBinaryOp(I, Op0, Op1)) in visitFMul()
942 Y = Op1; in visitFMul()
944 if (match(Op1, m_OneUse(m_Intrinsic<Intrinsic::log2>( in visitFMul()
946 Log2 = cast<IntrinsicInst>(Op1); in visitFMul()
1087 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in foldIDivShl() local
1094 if (match(Op1, m_Shl(m_Value(X), m_Value(Z))) && in foldIDivShl()
1098 auto *Shl = cast<OverflowingBinaryOperator>(Op1); in foldIDivShl()
1107 if (IsSigned && HasNSW && (Op0->hasOneUse() || Op1->hasOneUse())) { in foldIDivShl()
1116 match(Op1, m_Shl(m_Value(Y), m_Specific(Z)))) { in foldIDivShl()
1118 auto *Shl1 = cast<OverflowingBinaryOperator>(Op1); in foldIDivShl()
1139 match(Op1, m_Shl(m_Specific(X), m_Value(Z)))) { in foldIDivShl()
1141 auto *Shl1 = cast<OverflowingBinaryOperator>(Op1); in foldIDivShl()
1169 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in commonIDivTransforms() local
1186 match(Op1, m_Select(m_Value(), m_ImmConstant(), m_ImmConstant()))) { in commonIDivTransforms()
1187 if (Instruction *R = FoldOpIntoSelect(I, cast<SelectInst>(Op1), in commonIDivTransforms()
1193 if (match(Op1, m_APInt(C2))) { in commonIDivTransforms()
1283 Value *F1 = Op1; in commonIDivTransforms()
1284 if (!isGuaranteedNotToBeUndef(Op1)) in commonIDivTransforms()
1285 F1 = Builder.CreateFreeze(Op1, Op1->getName() + ".fr"); in commonIDivTransforms()
1292 return new ZExtInst(Builder.CreateICmpEQ(Op1, Op0), Ty); in commonIDivTransforms()
1303 if ((IsSigned && match(Z, m_SRem(m_Specific(X), m_Specific(Op1)))) || in commonIDivTransforms()
1304 (!IsSigned && match(Z, m_URem(m_Specific(X), m_Specific(Op1))))) in commonIDivTransforms()
1305 return BinaryOperator::Create(I.getOpcode(), X, Op1); in commonIDivTransforms()
1309 if (IsSigned && match(Op0, m_NSWShl(m_Specific(Op1), m_Value(Y)))) in commonIDivTransforms()
1311 if (!IsSigned && match(Op0, m_NUWShl(m_Specific(Op1), m_Value(Y)))) in commonIDivTransforms()
1315 if (match(Op1, m_c_Mul(m_Specific(Op0), m_Value(Y)))) { in commonIDivTransforms()
1316 bool HasNSW = cast<OverflowingBinaryOperator>(Op1)->hasNoSignedWrap(); in commonIDivTransforms()
1317 bool HasNUW = cast<OverflowingBinaryOperator>(Op1)->hasNoUnsignedWrap(); in commonIDivTransforms()
1327 if (!IsSigned && Op1->hasOneUse() && in commonIDivTransforms()
1329 match(Op1, m_c_Mul(m_Specific(X), m_Value(Y)))) in commonIDivTransforms()
1330 if (cast<OverflowingBinaryOperator>(Op1)->hasNoUnsignedWrap()) { in commonIDivTransforms()
1343 if (match(Op0, m_BinOp(I.getOpcode(), m_c_Mul(m_Specific(Op1), m_Value(X)), in commonIDivTransforms()
1366 auto OB1HasNSW = cast<OverflowingBinaryOperator>(Op1)->hasNoSignedWrap(); in commonIDivTransforms()
1368 cast<OverflowingBinaryOperator>(Op1)->hasNoUnsignedWrap(); in commonIDivTransforms()
1383 if (match(Op1, m_c_Mul(m_Specific(X), m_Value(Z)))) { in commonIDivTransforms()
1387 if (match(Op1, m_c_Mul(m_Specific(Y), m_Value(Z)))) { in commonIDivTransforms()
1526 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitUDiv() local
1529 if (match(Op0, m_LShr(m_Value(X), m_APInt(C1))) && match(Op1, m_APInt(C2))) { in visitUDiv()
1546 if (match(Op1, m_Negative())) { in visitUDiv()
1547 Value *Cmp = Builder.CreateICmpUGE(Op0, Op1); in visitUDiv()
1551 if (match(Op1, m_SExt(m_Value(X))) && X->getType()->isIntOrIntVectorTy(1)) { in visitUDiv()
1563 if (match(Op0, m_LShr(m_NUWMul(m_Specific(Op1), m_Value(A)), m_Value(B))) || in visitUDiv()
1564 match(Op0, m_LShr(m_NUWMul(m_Value(A), m_Specific(Op1)), m_Value(B)))) { in visitUDiv()
1572 if (takeLog2(Builder, Op1, /*Depth*/ 0, /*AssumeNonZero*/ true, in visitUDiv()
1574 Value *Res = takeLog2(Builder, Op1, /*Depth*/ 0, in visitUDiv()
1595 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitSDiv() local
1600 if (match(Op1, m_AllOnes()) || in visitSDiv()
1601 (match(Op1, m_SExt(m_Value(X))) && X->getType()->isIntOrIntVectorTy(1))) in visitSDiv()
1605 if (match(Op1, m_SignMask())) in visitSDiv()
1606 return new ZExtInst(Builder.CreateICmpEQ(Op0, Op1), Ty); in visitSDiv()
1610 if (match(Op1, m_Power2()) && match(Op1, m_NonNegative())) { in visitSDiv()
1611 Constant *C = ConstantExpr::getExactLogBase2(cast<Constant>(Op1)); in visitSDiv()
1617 if (match(Op1, m_NSWShl(m_One(), m_Value(ShAmt)))) in visitSDiv()
1621 if (match(Op1, m_NegatedPower2())) { in visitSDiv()
1622 Constant *NegPow2C = ConstantExpr::getNeg(cast<Constant>(Op1)); in visitSDiv()
1630 if (match(Op1, m_APInt(Op1C))) { in visitSDiv()
1644 ConstantExpr::getTrunc(cast<Constant>(Op1), Op0Src->getType()); in visitSDiv()
1678 (match(Op1, m_Power2(Op1C)) || match(Op1, m_NegatedPower2(Op1C))) && in visitSDiv()
1686 if (isKnownNonNegative(Op1, SQ.getWithInstruction(&I))) { in visitSDiv()
1687 auto *BO = BinaryOperator::CreateUDiv(Op0, Op1, I.getName()); in visitSDiv()
1692 if (match(Op1, m_NegatedPower2())) { in visitSDiv()
1696 ConstantExpr::getNeg(cast<Constant>(Op1))); in visitSDiv()
1701 if (isKnownToBeAPowerOfTwo(Op1, /*OrZero*/ true, 0, &I)) { in visitSDiv()
1706 auto *BO = BinaryOperator::CreateUDiv(Op0, Op1, I.getName()); in visitSDiv()
1713 if (isKnownNegation(Op0, Op1)) { in visitSDiv()
1805 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in foldFDivPowDivisor() local
1806 auto *II = dyn_cast<IntrinsicInst>(Op1); in foldFDivPowDivisor()
1854 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in foldFDivSqrtDivisor() local
1855 auto *II = dyn_cast<IntrinsicInst>(Op1); in foldFDivSqrtDivisor()
1898 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitFDiv() local
1900 if (SelectInst *SI = dyn_cast<SelectInst>(Op1)) in visitFDiv()
1904 if (isa<Constant>(Op1)) in visitFDiv()
1912 (!isa<Constant>(Y) || !isa<Constant>(Op1))) { in visitFDiv()
1914 Value *YZ = Builder.CreateFMulFMF(Y, Op1, &I); in visitFDiv()
1917 if (match(Op1, m_OneUse(m_FDiv(m_Value(X), m_Value(Y)))) && in visitFDiv()
1929 if (match(Op1, m_FDiv(m_SpecificFP(1.0), m_Value(Y)))) in visitFDiv()
1933 if (I.hasAllowReassoc() && Op0->hasOneUse() && Op1->hasOneUse()) { in visitFDiv()
1938 match(Op1, m_Intrinsic<Intrinsic::cos>(m_Specific(X))); in visitFDiv()
1941 match(Op1, m_Intrinsic<Intrinsic::sin>(m_Specific(X))); in visitFDiv()
1963 match(Op1, m_c_FMul(m_Specific(Op0), m_Value(Y)))) { in visitFDiv()
1987 match(Op0, m_OneUse(m_Intrinsic<Intrinsic::pow>(m_Specific(Op1), in visitFDiv()
1991 Value *Pow = Builder.CreateBinaryIntrinsic(Intrinsic::pow, Op1, Y1, &I); in visitFDiv()
2009 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1), *X = nullptr; in simplifyIRemMulShl() local
2043 if (MatchShiftOrMulXC(Op0, X, Y) && MatchShiftOrMulXC(Op1, X, Z)) { in simplifyIRemMulShl()
2045 } else if (MatchShiftCX(Op0, Y, X) && MatchShiftCX(Op1, Z, X)) { in simplifyIRemMulShl()
2078 OverflowingBinaryOperator *BO1 = cast<OverflowingBinaryOperator>(Op1); in simplifyIRemMulShl()
2114 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in commonIRemTransforms() local
2128 match(Op1, m_Select(m_Value(), m_ImmConstant(), m_ImmConstant()))) { in commonIRemTransforms()
2129 if (Instruction *R = FoldOpIntoSelect(I, cast<SelectInst>(Op1), in commonIRemTransforms()
2134 if (isa<Constant>(Op1)) { in commonIRemTransforms()
2141 if (match(Op1, m_APInt(Op1Int)) && !Op1Int->isMinValue() && in commonIRemTransforms()
2179 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitURem() local
2181 if (isKnownToBeAPowerOfTwo(Op1, /*OrZero*/ true, 0, &I)) { in visitURem()
2185 Value *Add = Builder.CreateAdd(Op1, N1); in visitURem()
2191 Value *Cmp = Builder.CreateICmpNE(Op1, ConstantInt::get(Ty, 1)); in visitURem()
2197 if (match(Op1, m_Negative())) { in visitURem()
2201 Value *Cmp = Builder.CreateICmpULT(F0, Op1); in visitURem()
2202 Value *Sub = Builder.CreateSub(F0, Op1); in visitURem()
2211 if (match(Op1, m_SExt(m_Value(X))) && X->getType()->isIntOrIntVectorTy(1)) { in visitURem()
2223 simplifyICmpInst(ICmpInst::ICMP_ULT, X, Op1, SQ.getWithInstruction(&I)); in visitURem()
2228 Value *Cmp = Builder.CreateICmpEQ(FrozenOp0, Op1); in visitURem()
2248 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitSRem() local
2252 if (match(Op1, m_Negative(Y)) && !Y->isMinSignedValue()) in visitSRem()
2264 if (MaskedValueIsZero(Op1, Mask, 0, &I) && in visitSRem()
2267 return BinaryOperator::CreateURem(Op0, Op1, I.getName()); in visitSRem()
2271 if (isa<ConstantVector>(Op1) || isa<ConstantDataVector>(Op1)) { in visitSRem()
2272 Constant *C = cast<Constant>(Op1); in visitSRem()