Lines Matching refs:Op0
2294 static bool swapMayExposeCSEOpportunities(const Value * Op0, in swapMayExposeCSEOpportunities() argument
2298 if (Op0->getType()->isPointerTy()) in swapMayExposeCSEOpportunities()
2308 for (const User *U : Op0->users()) { in swapMayExposeCSEOpportunities()
2316 if (BinOp->getOperand(Op1Idx) == Op0) { in swapMayExposeCSEOpportunities()
2329 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitICmpInst() local
2330 unsigned Op0Cplxity = getComplexity(Op0); in visitICmpInst()
2338 swapMayExposeCSEOpportunities(Op0, Op1))) { in visitICmpInst()
2340 std::swap(Op0, Op1); in visitICmpInst()
2344 if (Value *V = SimplifyICmpInst(I.getPredicate(), Op0, Op1, DL)) in visitICmpInst()
2352 if (match(Op0, m_Select(m_Value(Cond), m_Value(SelectTrue), in visitICmpInst()
2365 Type *Ty = Op0->getType(); in visitICmpInst()
2372 Value *Xor = Builder->CreateXor(Op0, Op1, I.getName()+"tmp"); in visitICmpInst()
2376 return BinaryOperator::CreateXor(Op0, Op1); in visitICmpInst()
2379 std::swap(Op0, Op1); // Change icmp ugt -> icmp ult in visitICmpInst()
2382 Value *Not = Builder->CreateNot(Op0, I.getName()+"tmp"); in visitICmpInst()
2386 std::swap(Op0, Op1); // Change icmp sgt -> icmp slt in visitICmpInst()
2390 return BinaryOperator::CreateAnd(Not, Op0); in visitICmpInst()
2393 std::swap(Op0, Op1); // Change icmp uge -> icmp ule in visitICmpInst()
2396 Value *Not = Builder->CreateNot(Op0, I.getName()+"tmp"); in visitICmpInst()
2400 std::swap(Op0, Op1); // Change icmp sge -> icmp sle in visitICmpInst()
2404 return BinaryOperator::CreateOr(Not, Op0); in visitICmpInst()
2436 match(Op0, m_Add(m_Add(m_Value(A), m_Value(B)), m_ConstantInt(CI2)))) in visitICmpInst()
2443 match(Op0, m_Sub(m_Value(A), m_Value(B)))) { in visitICmpInst()
2456 return new ICmpInst(ICmpInst::ICMP_ULT, Op0, in visitICmpInst()
2460 return new ICmpInst(ICmpInst::ICMP_SLT, Op0, in visitICmpInst()
2464 return new ICmpInst(ICmpInst::ICMP_UGT, Op0, in visitICmpInst()
2468 return new ICmpInst(ICmpInst::ICMP_SGT, Op0, in visitICmpInst()
2513 if (!isa<Constant>(Op0) && Op0Min == Op0Max) in visitICmpInst()
2515 ConstantInt::get(Op0->getType(), Op0Min), Op1); in visitICmpInst()
2517 return new ICmpInst(I.getPredicate(), Op0, in visitICmpInst()
2536 if (!match(Op0, m_And(m_Value(LHS), m_ConstantInt(LHSC))) || in visitICmpInst()
2538 LHS = Op0; in visitICmpInst()
2581 if (!match(Op0, m_And(m_Value(LHS), m_ConstantInt(LHSC))) || in visitICmpInst()
2583 LHS = Op0; in visitICmpInst()
2620 return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); in visitICmpInst()
2623 return new ICmpInst(ICmpInst::ICMP_EQ, Op0, in visitICmpInst()
2628 return new ICmpInst(ICmpInst::ICMP_SGT, Op0, in visitICmpInst()
2629 Constant::getAllOnesValue(Op0->getType())); in visitICmpInst()
2639 return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); in visitICmpInst()
2642 return new ICmpInst(ICmpInst::ICMP_EQ, Op0, in visitICmpInst()
2647 return new ICmpInst(ICmpInst::ICMP_SLT, Op0, in visitICmpInst()
2648 Constant::getNullValue(Op0->getType())); in visitICmpInst()
2657 return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); in visitICmpInst()
2660 return new ICmpInst(ICmpInst::ICMP_EQ, Op0, in visitICmpInst()
2671 return new ICmpInst(ICmpInst::ICMP_NE, Op0, Op1); in visitICmpInst()
2674 return new ICmpInst(ICmpInst::ICMP_EQ, Op0, in visitICmpInst()
2713 return new ICmpInst(I.getUnsignedPredicate(), Op0, Op1); in visitICmpInst()
2725 if ((SI->getOperand(1) == Op0 && SI->getOperand(2) == Op1) || in visitICmpInst()
2726 (SI->getOperand(2) == Op0 && SI->getOperand(1) == Op1)) in visitICmpInst()
2735 if (Instruction *LHSI = dyn_cast<Instruction>(Op0)) in visitICmpInst()
2742 if (Instruction *LHSI = dyn_cast<Instruction>(Op0)) in visitICmpInst()
2810 if (GEPOperator *GEP = dyn_cast<GEPOperator>(Op0)) in visitICmpInst()
2814 if (Instruction *NI = FoldGEPICmp(GEP, Op0, in visitICmpInst()
2821 if (BitCastInst *CI = dyn_cast<BitCastInst>(Op0)) { in visitICmpInst()
2822 if (Op0->getType()->isPointerTy() && in visitICmpInst()
2826 Op0 = CI->getOperand(0); in visitICmpInst()
2834 if (Op0->getType() != Op1->getType()) { in visitICmpInst()
2836 Op1 = ConstantExpr::getBitCast(Op1C, Op0->getType()); in visitICmpInst()
2839 Op1 = Builder->CreateBitCast(Op1, Op0->getType()); in visitICmpInst()
2842 return new ICmpInst(I.getPredicate(), Op0, Op1); in visitICmpInst()
2846 if (isa<CastInst>(Op0)) { in visitICmpInst()
2859 BinaryOperator *BO0 = dyn_cast<BinaryOperator>(Op0); in visitICmpInst()
2887 if ((C == Op0 || D == Op0) && NoOp1WrapProblem) in visitICmpInst()
2888 return new ICmpInst(Pred, Constant::getNullValue(Op0->getType()), in visitICmpInst()
2889 C == Op0 ? D : C); in visitICmpInst()
2981 if (C == Op0 && NoOp1WrapProblem) in visitICmpInst()
2982 return new ICmpInst(Pred, D, Constant::getNullValue(Op0->getType())); in visitICmpInst()
3013 Op0 == BO1->getOperand(1)) in visitICmpInst()
3114 if (match(Op0, m_And(m_Value(A), m_Not(m_Value(B)))) && in visitICmpInst()
3122 if (match(Op0, m_Not(m_Value(A)))) { in visitICmpInst()
3132 match(Op0, m_Add(m_Value(A), m_Value(B))) && in visitICmpInst()
3134 if (Instruction *R = ProcessUAddIdiom(I, Op0, *this)) in visitICmpInst()
3141 (Op0 == A || Op0 == B)) in visitICmpInst()
3146 if (match(Op0, m_Mul(m_ZExt(m_Value(A)), m_ZExt(m_Value(B))))) { in visitICmpInst()
3147 if (Instruction *R = ProcessUMulZExtIdiom(I, Op0, Op1, *this)) in visitICmpInst()
3151 if (Instruction *R = ProcessUMulZExtIdiom(I, Op1, Op0, *this)) in visitICmpInst()
3159 if (match(Op0, m_Xor(m_Value(A), m_Value(B)))) { in visitICmpInst()
3185 (A == Op0 || B == Op0)) { in visitICmpInst()
3187 Value *OtherVal = A == Op0 ? B : A; in visitICmpInst()
3193 if (match(Op0, m_OneUse(m_And(m_Value(A), m_Value(B)))) && in visitICmpInst()
3219 if ((Op0->hasOneUse() && in visitICmpInst()
3220 match(Op0, m_ZExt(m_Value(A))) && in visitICmpInst()
3223 match(Op0, m_And(m_Value(B), m_ConstantInt(Cst1))) && in visitICmpInst()
3234 if ((match(Op0, m_OneUse(m_LShr(m_Value(A), m_ConstantInt(Cst1)))) && in visitICmpInst()
3236 (match(Op0, m_OneUse(m_AShr(m_Value(A), m_ConstantInt(Cst1)))) && in visitICmpInst()
3253 if (Op0->hasOneUse() && in visitICmpInst()
3254 match(Op0, m_Trunc(m_OneUse(m_LShr(m_Value(A), in visitICmpInst()
3264 APInt::getLowBitsSet(ASize, Op0->getType()->getPrimitiveSizeInBits()); in visitICmpInst()
3279 if (match(Op0, m_Add(m_Value(X), m_ConstantInt(Cst))) && Op1 == X) in visitICmpInst()
3283 if (match(Op1, m_Add(m_Value(X), m_ConstantInt(Cst))) && Op0 == X) in visitICmpInst()
3503 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitFCmpInst() local
3505 if (Value *V = SimplifyFCmpInst(I.getPredicate(), Op0, Op1, DL)) in visitFCmpInst()
3509 if (Op0 == Op1) { in visitFCmpInst()
3518 I.setOperand(1, Constant::getNullValue(Op0->getType())); in visitFCmpInst()
3527 I.setOperand(1, Constant::getNullValue(Op0->getType())); in visitFCmpInst()
3534 if (Instruction *LHSI = dyn_cast<Instruction>(Op0)) in visitFCmpInst()
3650 if (match(Op0, m_FNeg(m_Value(X))) && match(Op1, m_FNeg(m_Value(Y)))) in visitFCmpInst()
3654 if (FPExtInst *LHSExt = dyn_cast<FPExtInst>(Op0)) in visitFCmpInst()