Lines Matching refs:Op1
2593 const Value * Op1) { in swapMayExposeCSEOpportunities() argument
2618 if (BinOp->getOperand(Op1Idx) != Op1) in swapMayExposeCSEOpportunities()
2743 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitICmpInst() local
2745 unsigned Op1Cplxity = getComplexity(Op1); in visitICmpInst()
2752 swapMayExposeCSEOpportunities(Op0, Op1))) { in visitICmpInst()
2754 std::swap(Op0, Op1); in visitICmpInst()
2759 SimplifyICmpInst(I.getPredicate(), Op0, Op1, DL, TLI, DT, AC, &I)) in visitICmpInst()
2764 if (I.getPredicate() == ICmpInst::ICMP_NE && match(Op1, m_Zero())) in visitICmpInst()
2771 return CmpInst::Create(Instruction::ICmp, I.getPredicate(), V, Op1); in visitICmpInst()
2775 return CmpInst::Create(Instruction::ICmp, I.getPredicate(), V, Op1); in visitICmpInst()
2787 Value *Xor = Builder->CreateXor(Op0, Op1, I.getName()+"tmp"); in visitICmpInst()
2791 return BinaryOperator::CreateXor(Op0, Op1); in visitICmpInst()
2794 std::swap(Op0, Op1); // Change icmp ugt -> icmp ult in visitICmpInst()
2798 return BinaryOperator::CreateAnd(Not, Op1); in visitICmpInst()
2801 std::swap(Op0, Op1); // Change icmp sgt -> icmp slt in visitICmpInst()
2804 Value *Not = Builder->CreateNot(Op1, I.getName()+"tmp"); in visitICmpInst()
2808 std::swap(Op0, Op1); // Change icmp uge -> icmp ule in visitICmpInst()
2812 return BinaryOperator::CreateOr(Not, Op1); in visitICmpInst()
2815 std::swap(Op0, Op1); // Change icmp sge -> icmp sle in visitICmpInst()
2818 Value *Not = Builder->CreateNot(Op1, I.getName()+"tmp"); in visitICmpInst()
2833 if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) { in visitICmpInst()
2967 ConstantInt::get(Op0->getType(), Op0Min), Op1); in visitICmpInst()
2968 if (!isa<Constant>(Op1) && Op1Min == Op1Max) in visitICmpInst()
2970 ConstantInt::get(Op1->getType(), Op1Min)); in visitICmpInst()
3070 return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); in visitICmpInst()
3071 if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) { in visitICmpInst()
3089 return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); in visitICmpInst()
3090 if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) { in visitICmpInst()
3107 return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); in visitICmpInst()
3108 if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) { in visitICmpInst()
3121 return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); in visitICmpInst()
3122 if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) { in visitICmpInst()
3129 assert(!isa<ConstantInt>(Op1) && "ICMP_SGE with ConstantInt not folded!"); in visitICmpInst()
3136 assert(!isa<ConstantInt>(Op1) && "ICMP_SLE with ConstantInt not folded!"); in visitICmpInst()
3143 assert(!isa<ConstantInt>(Op1) && "ICMP_UGE with ConstantInt not folded!"); in visitICmpInst()
3150 assert(!isa<ConstantInt>(Op1) && "ICMP_ULE with ConstantInt not folded!"); in visitICmpInst()
3163 return new ICmpInst(I.getUnsignedPredicate(), Op0, Op1); in visitICmpInst()
3175 if ((SI->getOperand(1) == Op0 && SI->getOperand(2) == Op1) || in visitICmpInst()
3176 (SI->getOperand(2) == Op0 && SI->getOperand(1) == Op1)) in visitICmpInst()
3181 if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) { in visitICmpInst()
3191 if (Constant *RHSC = dyn_cast<Constant>(Op1)) { in visitICmpInst()
3213 Value *Op1 = nullptr, *Op2 = nullptr; in visitICmpInst() local
3216 Op1 = ConstantExpr::getICmp(I.getPredicate(), C, RHSC); in visitICmpInst()
3217 CI = dyn_cast<ConstantInt>(Op1); in visitICmpInst()
3232 if (Op1 && Op2) in visitICmpInst()
3234 else if (Op1 || Op2) { in visitICmpInst()
3244 Op1 ? 2 : 1); in visitICmpInst()
3247 if (!Op1) in visitICmpInst()
3248 Op1 = Builder->CreateICmp(I.getPredicate(), LHSI->getOperand(1), in visitICmpInst()
3253 return SelectInst::Create(LHSI->getOperand(0), Op1, Op2); in visitICmpInst()
3281 if (Instruction *NI = FoldGEPICmp(GEP, Op1, I.getPredicate(), I)) in visitICmpInst()
3283 if (GEPOperator *GEP = dyn_cast<GEPOperator>(Op1)) in visitICmpInst()
3290 assert(Op1->getType()->isPointerTy() && "Comparing pointer with non-pointer?"); in visitICmpInst()
3292 if (Instruction *New = FoldAllocaCmp(I, Alloca, Op1)) in visitICmpInst()
3294 if (auto *Alloca = dyn_cast<AllocaInst>(GetUnderlyingObject(Op1, DL))) in visitICmpInst()
3304 (isa<Constant>(Op1) || isa<BitCastInst>(Op1))) { in visitICmpInst()
3311 if (BitCastInst *CI2 = dyn_cast<BitCastInst>(Op1)) in visitICmpInst()
3312 Op1 = CI2->getOperand(0); in visitICmpInst()
3315 if (Op0->getType() != Op1->getType()) { in visitICmpInst()
3316 if (Constant *Op1C = dyn_cast<Constant>(Op1)) { in visitICmpInst()
3317 Op1 = ConstantExpr::getBitCast(Op1C, Op0->getType()); in visitICmpInst()
3320 Op1 = Builder->CreateBitCast(Op1, Op0->getType()); in visitICmpInst()
3323 return new ICmpInst(I.getPredicate(), Op0, Op1); in visitICmpInst()
3334 if (isa<Constant>(Op1) || isa<CastInst>(Op1)) in visitICmpInst()
3341 BinaryOperator *BO1 = dyn_cast<BinaryOperator>(Op1); in visitICmpInst()
3363 if (NoOp0WrapProblem && ICmpInst::isSigned(Pred) && match(Op1, m_Zero())) in visitICmpInst()
3369 if ((A == Op1 || B == Op1) && NoOp0WrapProblem) in visitICmpInst()
3370 return new ICmpInst(Pred, A == Op1 ? B : A, in visitICmpInst()
3371 Constant::getNullValue(Op1->getType())); in visitICmpInst()
3409 return new ICmpInst(CmpInst::ICMP_SLE, A, Op1); in visitICmpInst()
3414 return new ICmpInst(CmpInst::ICMP_SGT, A, Op1); in visitICmpInst()
3419 return new ICmpInst(CmpInst::ICMP_SLT, A, Op1); in visitICmpInst()
3424 return new ICmpInst(CmpInst::ICMP_SGE, A, Op1); in visitICmpInst()
3484 if (A == Op1 && NoOp0WrapProblem) in visitICmpInst()
3485 return new ICmpInst(Pred, Constant::getNullValue(Op1->getType()), B); in visitICmpInst()
3507 if (ConstantInt *RHSC = dyn_cast<ConstantInt>(Op1)) in visitICmpInst()
3516 Op1 == BO0->getOperand(1)) in visitICmpInst()
3618 auto LSubOne = m_Add(m_Specific(Op1), m_AllOnes()); in visitICmpInst()
3624 return new ICmpInst(ICmpInst::ICMP_NE, Op1, Zero); in visitICmpInst()
3634 match(Op1, m_Zero()) && in visitICmpInst()
3638 Op1); in visitICmpInst()
3643 if (match(Op1, m_Not(m_Value(B)))) in visitICmpInst()
3645 if (ConstantInt *RHSC = dyn_cast<ConstantInt>(Op1)) in visitICmpInst()
3664 if (Instruction *R = ProcessUMulZExtIdiom(I, Op0, Op1, *this)) in visitICmpInst()
3667 if (match(Op1, m_Mul(m_ZExt(m_Value(A)), m_ZExt(m_Value(B))))) { in visitICmpInst()
3668 if (Instruction *R = ProcessUMulZExtIdiom(I, Op1, Op0, *this)) in visitICmpInst()
3677 if (A == Op1 || B == Op1) { // (A^B) == A -> B == 0 in visitICmpInst()
3678 Value *OtherVal = A == Op1 ? B : A; in visitICmpInst()
3683 if (match(Op1, m_Xor(m_Value(C), m_Value(D)))) { in visitICmpInst()
3687 match(D, m_ConstantInt(C2)) && Op1->hasOneUse()) { in visitICmpInst()
3701 if (match(Op1, m_Xor(m_Value(A), m_Value(B))) && in visitICmpInst()
3711 match(Op1, m_OneUse(m_And(m_Value(C), m_Value(D))))) { in visitICmpInst()
3725 Op1 = Builder->CreateXor(X, Y); in visitICmpInst()
3726 Op1 = Builder->CreateAnd(Op1, Z); in visitICmpInst()
3727 I.setOperand(0, Op1); in visitICmpInst()
3728 I.setOperand(1, Constant::getNullValue(Op1->getType())); in visitICmpInst()
3738 match(Op1, m_And(m_Value(B), m_ConstantInt(Cst1)))) || in visitICmpInst()
3739 (Op1->hasOneUse() && in visitICmpInst()
3741 match(Op1, m_ZExt(m_Value(A))))) { in visitICmpInst()
3752 match(Op1, m_OneUse(m_LShr(m_Value(B), m_Specific(Cst1))))) || in visitICmpInst()
3754 match(Op1, m_OneUse(m_AShr(m_Value(B), m_Specific(Cst1)))))) { in visitICmpInst()
3769 match(Op1, m_OneUse(m_Shl(m_Value(B), m_Specific(Cst1))))) { in visitICmpInst()
3788 match(Op1, m_ConstantInt(Cst1)) && in visitICmpInst()
3820 if (EVI->getIndices()[0] == 0 && ACXI->getCompareOperand() == Op1 && in visitICmpInst()
3827 if (match(Op0, m_Add(m_Value(X), m_ConstantInt(Cst))) && Op1 == X) in visitICmpInst()
3831 if (match(Op1, m_Add(m_Value(X), m_ConstantInt(Cst))) && Op0 == X) in visitICmpInst()
4088 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitFCmpInst() local
4090 if (Value *V = SimplifyFCmpInst(I.getPredicate(), Op0, Op1, in visitFCmpInst()
4095 if (Op0 == Op1) { in visitFCmpInst()
4127 if ((SI->getOperand(1) == Op0 && SI->getOperand(2) == Op1) || in visitFCmpInst()
4128 (SI->getOperand(2) == Op0 && SI->getOperand(1) == Op1)) in visitFCmpInst()
4132 if (Constant *RHSC = dyn_cast<Constant>(Op1)) { in visitFCmpInst()
4251 if (match(Op0, m_FNeg(m_Value(X))) && match(Op1, m_FNeg(m_Value(Y)))) in visitFCmpInst()
4256 if (FPExtInst *RHSExt = dyn_cast<FPExtInst>(Op1)) in visitFCmpInst()