Lines Matching refs:Op0
406 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in commonShiftTransforms() local
407 assert(Op0->getType() == Op1->getType()); in commonShiftTransforms()
414 return BinaryOperator::Create(I.getOpcode(), Op0, NewExt); in commonShiftTransforms()
422 if (isa<Constant>(Op0)) in commonShiftTransforms()
428 if (Instruction *Res = FoldShiftByConstant(Op0, CUI, I)) in commonShiftTransforms()
439 if (match(Op0, m_Constant(C)) && in commonShiftTransforms()
453 if (match(Op0, m_APInt(AC)) && match(Op1, m_Add(m_Value(A), m_APInt(AddC))) && in commonShiftTransforms()
757 Instruction *InstCombinerImpl::FoldShiftByConstant(Value *Op0, Constant *C1, in FoldShiftByConstant() argument
763 if (match(Op0, m_BinOp(I.getOpcode(), m_ImmConstant(C2), m_Value(X)))) in FoldShiftByConstant()
775 match(Op0, m_SDiv(m_Value(X), m_APInt(DivC))) && !DivC->isZero() && in FoldShiftByConstant()
796 canEvaluateShifted(Op0, Op1C->getZExtValue(), IsLeftShift, *this, &I)) { in FoldShiftByConstant()
800 << *Op0 << "\n SH: " << I << "\n"); in FoldShiftByConstant()
803 I, getShiftedValue(Op0, Op1C->getZExtValue(), IsLeftShift, *this, DL)); in FoldShiftByConstant()
809 if (!Op0->hasOneUse()) in FoldShiftByConstant()
812 if (auto *Op0BO = dyn_cast<BinaryOperator>(Op0)) { in FoldShiftByConstant()
841 if (match(Op0, m_Select(m_Value(Cond), m_OneUse(m_BinOp(TBO)), in FoldShiftByConstant()
858 if (match(Op0, m_Select(m_Value(Cond), m_Value(TrueVal), in FoldShiftByConstant()
1016 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitShl() local
1027 if (match(Op0, m_OneUse(m_ZExt(m_Value(X))))) { in visitShl()
1035 if (match(Op0, m_Shr(m_Value(X), m_Specific(Op1)))) { in visitShl()
1041 if (match(Op0, m_Exact(m_Shr(m_Value(X), m_APInt(C1)))) && in visitShl()
1051 cast<Instruction>(Op0)->getOpcode() == Instruction::LShr && in visitShl()
1060 cast<BinaryOperator>(Op0)->getOpcode(), X, ShiftDiff); in visitShl()
1066 if (match(Op0, m_OneUse(m_Shr(m_Value(X), m_APInt(C1)))) && in visitShl()
1076 cast<Instruction>(Op0)->getOpcode() == Instruction::LShr && in visitShl()
1086 auto *OldShr = cast<BinaryOperator>(Op0); in visitShl()
1098 if (match(Op0, m_OneUse(m_Trunc(m_OneUse(m_BinOp(Shr))))) && in visitShl()
1116 if (match(Op0, m_Shl(m_Value(X), m_APInt(C1))) && C1->ult(BitWidth)) { in visitShl()
1141 if (match(Op0, m_OneUse(m_BinOp(Op0BO))) && in visitShl()
1183 if (match(Op0, m_OneUse(m_Sub(m_APInt(C1), m_Value(X))))) { in visitShl()
1196 if (match(Op0, m_OneUse(m_Shr(m_Value(X), m_Specific(Op1))))) { in visitShl()
1207 if (match(Op0, m_Mul(m_Value(X), m_Constant(C2)))) in visitShl()
1211 if (match(Op0, m_ZExt(m_Value(X))) && X->getType()->isIntOrIntVectorTy(1)) { in visitShl()
1217 if (match(Op0, m_One())) { in visitShl()
1246 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitLShr() local
1253 if (match(Op0, m_OneUse(m_Not(m_Value(X)))) && in visitLShr()
1259 auto *II = dyn_cast<IntrinsicInst>(Op0); in visitLShr()
1275 if (match(Op0, m_Shl(m_Value(X), m_APInt(C1))) && C1->ult(BitWidth)) { in visitLShr()
1279 if (cast<BinaryOperator>(Op0)->hasNoUnsignedWrap()) { in visitLShr()
1285 if (Op0->hasOneUse()) { in visitLShr()
1294 if (cast<BinaryOperator>(Op0)->hasNoUnsignedWrap()) { in visitLShr()
1301 if (Op0->hasOneUse()) { in visitLShr()
1319 if (match(Op0, in visitLShr()
1330 if (match(Op0, m_OneUse(m_ZExt(m_Value(X)))) && in visitLShr()
1339 if (match(Op0, m_SExt(m_Value(X)))) { in visitLShr()
1349 Op0->hasOneUse()) { in visitLShr()
1369 if (match(Op0, m_OneUse(m_c_Or(m_Neg(m_Value(X)), m_Deferred(X))))) in visitLShr()
1373 if (match(Op0, m_OneUse(m_NSWSub(m_Value(X), m_Value(Y))))) in visitLShr()
1378 if (match(Op0, m_OneUse(m_SRem(m_Value(X), m_SpecificInt(2))))) { in visitLShr()
1385 if (match(Op0, m_LShr(m_Value(X), m_APInt(C1)))) { in visitLShr()
1393 if (match(Op0, m_OneUse(m_Trunc(m_Instruction(TruncSrc)))) && in visitLShr()
1416 if (match(Op0, m_NUWMul(m_Value(X), m_APInt(MulC)))) { in visitLShr()
1428 if (Op0->hasOneUse()) { in visitLShr()
1446 if (match(Op0, m_OneUse(m_Intrinsic<Intrinsic::bswap>( in visitLShr()
1468 if (ShAmtC == 1 && match(Op0, m_Add(m_Value(X), m_Value(Y))) && in visitLShr()
1472 (X->hasOneUse() || Y->hasOneUse() || Op0->hasOneUse())) { in visitLShr()
1483 if (match(Op0, m_OneUse(m_Shl(m_Value(X), m_Specific(Op1))))) { in visitLShr()
1575 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitAShr() local
1586 if (match(Op0, m_Shl(m_ZExt(m_Value(X)), m_Specific(Op1))) && in visitAShr()
1593 if (match(Op0, m_NSWShl(m_Value(X), m_APInt(ShOp1))) && in visitAShr()
1612 if (match(Op0, m_AShr(m_Value(X), m_APInt(ShOp1))) && in visitAShr()
1621 if (match(Op0, m_OneUse(m_SExt(m_Value(X)))) && in visitAShr()
1632 if (match(Op0, m_OneUse(m_c_Or(m_Neg(m_Value(X)), m_Deferred(X))))) in visitAShr()
1637 if (match(Op0, m_OneUse(m_NSWSub(m_Value(X), m_Value(Y))))) in visitAShr()
1651 match(Op0, m_OneUse(m_Shl(m_Value(X), in visitAShr()
1657 cast<Constant>(cast<Instruction>(Op0)->getOperand(1))); in visitAShr()
1666 if (MaskedValueIsZero(Op0, APInt::getSignMask(BitWidth), 0, &I)) { in visitAShr()
1667 Instruction *Lshr = BinaryOperator::CreateLShr(Op0, Op1); in visitAShr()
1673 if (match(Op0, m_OneUse(m_Not(m_Value(X))))) { in visitAShr()
1676 auto *NewAShr = Builder.CreateAShr(X, Op1, Op0->getName() + ".not"); in visitAShr()