Lines Matching refs:Op1
177 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitMul() local
182 if (Value *V = SimplifyMulInst(Op0, Op1, DL, TLI, DT, AC)) in visitMul()
189 if (match(Op1, m_AllOnes())) { in visitMul()
243 if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) { in visitMul()
269 if (isa<Constant>(Op1)) { in visitMul()
284 Value *Mul = Builder->CreateMul(C1, Op1); in visitMul()
288 return BinaryOperator::CreateAdd(Builder->CreateMul(X, Op1), Mul); in visitMul()
294 if (Value *Op1v = dyn_castNegVal(Op1)) { in visitMul()
298 match(Op1, m_NSWSub(m_Value(), m_Value()))) in visitMul()
307 Value *Op1C = Op1; in visitMul()
313 BO = dyn_cast<BinaryOperator>(Op1); in visitMul()
345 return BinaryOperator::CreateAnd(Op0, Op1); in visitMul()
354 BO = BinaryOperator::CreateShl(Op1, Y); in visitMul()
356 } else if (match(Op1, m_Shl(m_One(), m_Value(Y)))) { in visitMul()
358 ShlNSW = cast<ShlOperator>(Op1)->hasNoSignedWrap(); in visitMul()
378 BoolCast = Op0, OtherOp = Op1; in visitMul()
379 else if (MaskedValueIsZero(Op1, Negative2, 0, &I)) in visitMul()
380 BoolCast = Op1, OtherOp = Op0; in visitMul()
389 if (!I.hasNoSignedWrap() && WillNotOverflowSignedMul(Op0, Op1, I)) { in visitMul()
395 computeOverflowForUnsignedMul(Op0, Op1, &I) == in visitMul()
536 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitFMul() local
542 std::swap(Op0, Op1); in visitFMul()
545 SimplifyFMulInst(Op0, Op1, I.getFastMathFlags(), DL, TLI, DT, AC)) in visitFMul()
551 if (isa<Constant>(Op1)) { in visitFMul()
562 if (match(Op1, m_SpecificFP(-1.0))) { in visitFMul()
563 Constant *NegZero = ConstantFP::getNegativeZero(Op1->getType()); in visitFMul()
569 Constant *C = cast<Constant>(Op1); in visitFMul()
616 if (AllowReassociate && (Op0 == Op1)) in visitFMul()
629 OpX = Op1; in visitFMul()
631 detectLog2OfHalf(Op1, OpY, Log2); in visitFMul()
650 Value *Opnd1 = Op1; in visitFMul()
706 if (!isa<Constant>(Op1)) in visitFMul()
790 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in commonIDivTransforms() local
800 if (isa<SelectInst>(Op1) && SimplifyDivRemOfSelect(I)) in commonIDivTransforms()
805 if (match(Op1, m_APInt(C2))) { in commonIDivTransforms()
890 Value *Inc = Builder->CreateAdd(Op1, One); in commonIDivTransforms()
893 return SelectInst::Create(Cmp, Op1, ConstantInt::get(I.getType(), 0)); in commonIDivTransforms()
897 return new ZExtInst(Builder->CreateICmpEQ(Op1, One), I.getType()); in commonIDivTransforms()
910 if ((isSigned && match(Z, m_SRem(m_Specific(X), m_Specific(Op1)))) || in commonIDivTransforms()
911 (!isSigned && match(Z, m_URem(m_Specific(X), m_Specific(Op1))))) in commonIDivTransforms()
912 return BinaryOperator::Create(I.getOpcode(), X, Op1); in commonIDivTransforms()
933 typedef Instruction *(*FoldUDivOperandCb)(Value *Op0, Value *Op1,
960 static Instruction *foldUDivPow2Cst(Value *Op0, Value *Op1, in foldUDivPow2Cst() argument
962 const APInt &C = cast<Constant>(Op1)->getUniqueInteger(); in foldUDivPow2Cst()
971 static Instruction *foldUDivNegCst(Value *Op0, Value *Op1, in foldUDivNegCst() argument
973 Value *ICI = IC.Builder->CreateICmpULT(Op0, cast<ConstantInt>(Op1)); in foldUDivNegCst()
980 static Instruction *foldUDivShl(Value *Op0, Value *Op1, const BinaryOperator &I, in foldUDivShl() argument
982 Instruction *ShiftLeft = cast<Instruction>(Op1); in foldUDivShl()
991 if (ZExtInst *Z = dyn_cast<ZExtInst>(Op1)) in foldUDivShl()
1003 static size_t visitUDivOperand(Value *Op0, Value *Op1, const BinaryOperator &I, in visitUDivOperand() argument
1008 if (match(Op1, m_Power2())) { in visitUDivOperand()
1009 Actions.push_back(UDivFoldAction(foldUDivPow2Cst, Op1)); in visitUDivOperand()
1013 if (ConstantInt *C = dyn_cast<ConstantInt>(Op1)) in visitUDivOperand()
1021 if (match(Op1, m_Shl(m_Power2(), m_Value())) || in visitUDivOperand()
1022 match(Op1, m_ZExt(m_Shl(m_Power2(), m_Value())))) { in visitUDivOperand()
1023 Actions.push_back(UDivFoldAction(foldUDivShl, Op1)); in visitUDivOperand()
1031 if (SelectInst *SI = dyn_cast<SelectInst>(Op1)) in visitUDivOperand()
1035 Actions.push_back(UDivFoldAction(nullptr, Op1, LHSIdx - 1)); in visitUDivOperand()
1043 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitUDiv() local
1048 if (Value *V = SimplifyUDivInst(Op0, Op1, DL, TLI, DT, AC)) in visitUDiv()
1060 match(Op1, m_APInt(C2))) { in visitUDiv()
1076 if (Value *ZOp1 = dyn_castZExtVal(Op1, ZOp0->getSrcTy())) in visitUDiv()
1083 if (visitUDivOperand(Op0, Op1, I, UDivActions)) in visitUDiv()
1116 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitSDiv() local
1121 if (Value *V = SimplifySDivInst(Op0, Op1, DL, TLI, DT, AC)) in visitSDiv()
1129 if (match(Op1, m_AllOnes())) in visitSDiv()
1132 if (ConstantInt *RHS = dyn_cast<ConstantInt>(Op1)) { in visitSDiv()
1142 if (Constant *RHS = dyn_cast<Constant>(Op1)) { in visitSDiv()
1145 return new ZExtInst(Builder->CreateICmpEQ(Op0, Op1), I.getType()); in visitSDiv()
1161 if (MaskedValueIsZero(Op1, Mask, 0, &I)) { in visitSDiv()
1163 auto *BO = BinaryOperator::CreateUDiv(Op0, Op1, I.getName()); in visitSDiv()
1168 if (isKnownToBeAPowerOfTwo(Op1, DL, /*OrZero*/ true, 0, AC, &I, DT)) { in visitSDiv()
1173 auto *BO = BinaryOperator::CreateUDiv(Op0, Op1, I.getName()); in visitSDiv()
1214 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitFDiv() local
1219 if (Value *V = SimplifyFDivInst(Op0, Op1, I.getFastMathFlags(), in visitFDiv()
1224 if (SelectInst *SI = dyn_cast<SelectInst>(Op1)) in visitFDiv()
1231 if (Constant *Op1C = dyn_cast<Constant>(Op1)) { in visitFDiv()
1281 if (match(Op1, m_FMul(m_Value(X), m_Constant(C2)))) in visitFDiv()
1283 else if (match(Op1, m_FDiv(m_Value(X), m_Constant(C2)))) { in visitFDiv()
1286 } else if (match(Op1, m_FDiv(m_Constant(C2), m_Value(X)))) { in visitFDiv()
1309 if (!isa<Constant>(Y) || !isa<Constant>(Op1)) { in visitFDiv()
1310 NewInst = Builder->CreateFMul(Y, Op1); in visitFDiv()
1318 } else if (Op1->hasOneUse() && match(Op1, m_FDiv(m_Value(X), m_Value(Y)))) { in visitFDiv()
1325 Flags &= cast<Instruction>(Op1)->getFastMathFlags(); in visitFDiv()
1348 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in commonIRemTransforms() local
1357 if (isa<SelectInst>(Op1) && SimplifyDivRemOfSelect(I)) in commonIRemTransforms()
1360 if (isa<Constant>(Op1)) { in commonIRemTransforms()
1380 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitURem() local
1385 if (Value *V = SimplifyURemInst(Op0, Op1, DL, TLI, DT, AC)) in visitURem()
1393 if (Value *ZOp1 = dyn_castZExtVal(Op1, ZOp0->getSrcTy())) in visitURem()
1398 if (isKnownToBeAPowerOfTwo(Op1, DL, /*OrZero*/ true, 0, AC, &I, DT)) { in visitURem()
1400 Value *Add = Builder->CreateAdd(Op1, N1); in visitURem()
1406 Value *Cmp = Builder->CreateICmpNE(Op1, Op0); in visitURem()
1415 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitSRem() local
1420 if (Value *V = SimplifySRemInst(Op0, Op1, DL, TLI, DT, AC)) in visitSRem()
1430 if (match(Op1, m_APInt(Y)) && Y->isNegative() && !Y->isMinSignedValue()) { in visitSRem()
1441 if (MaskedValueIsZero(Op1, Mask, 0, &I) && in visitSRem()
1444 return BinaryOperator::CreateURem(Op0, Op1, I.getName()); in visitSRem()
1449 if (isa<ConstantVector>(Op1) || isa<ConstantDataVector>(Op1)) { in visitSRem()
1450 Constant *C = cast<Constant>(Op1); in visitSRem()
1490 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitFRem() local
1495 if (Value *V = SimplifyFRemInst(Op0, Op1, I.getFastMathFlags(), in visitFRem()
1500 if (isa<SelectInst>(Op1) && SimplifyDivRemOfSelect(I)) in visitFRem()