Lines Matching refs:CmpInst

89 static bool isSameCompare(Value *V, CmpInst::Predicate Pred, Value *LHS,  in isSameCompare()
91 CmpInst *Cmp = dyn_cast<CmpInst>(V); in isSameCompare()
94 CmpInst::Predicate CPred = Cmp->getPredicate(); in isSameCompare()
98 return CPred == CmpInst::getSwappedPredicate(Pred) && CLHS == RHS && in isSameCompare()
368 static Value *ThreadCmpOverSelect(CmpInst::Predicate Pred, Value *LHS, in ThreadCmpOverSelect()
378 Pred = CmpInst::getSwappedPredicate(Pred); in ThreadCmpOverSelect()
493 static Value *ThreadCmpOverPHI(CmpInst::Predicate Pred, Value *LHS, Value *RHS, in ThreadCmpOverPHI()
502 Pred = CmpInst::getSwappedPredicate(Pred); in ThreadCmpOverPHI()
1896 return CmpInst::makeCmpResultType(Op->getType()); in GetCompareTy()
1902 static Value *ExtractEquivalentCondition(Value *V, CmpInst::Predicate Pred, in ExtractEquivalentCondition()
1907 CmpInst *Cmp = dyn_cast<CmpInst>(SI->getCondition()); in ExtractEquivalentCondition()
1913 if (Pred == CmpInst::getSwappedPredicate(Cmp->getPredicate()) && in ExtractEquivalentCondition()
1949 CmpInst::Predicate Pred, Value *LHS, in computePointerICmp()
1957 (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_NE)) in computePointerICmp()
1959 !CmpInst::isTrueWhenEqual(Pred)); in computePointerICmp()
1967 case CmpInst::ICMP_EQ: in computePointerICmp()
1968 case CmpInst::ICMP_NE: in computePointerICmp()
1973 case CmpInst::ICMP_UGT: in computePointerICmp()
1974 case CmpInst::ICMP_UGE: in computePointerICmp()
1975 case CmpInst::ICMP_ULT: in computePointerICmp()
1976 case CmpInst::ICMP_ULE: in computePointerICmp()
1998 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_NE) { in computePointerICmp()
2043 !CmpInst::isTrueWhenEqual(Pred)); in computePointerICmp()
2054 !CmpInst::isTrueWhenEqual(Pred)); in computePointerICmp()
2110 !CmpInst::isTrueWhenEqual(Pred)); in computePointerICmp()
2121 CmpInst::Predicate Pred = (CmpInst::Predicate)Predicate; in SimplifyICmpInst()
2122 assert(CmpInst::isIntPredicate(Pred) && "Not an integer compare!"); in SimplifyICmpInst()
2130 Pred = CmpInst::getSwappedPredicate(Pred); in SimplifyICmpInst()
2140 return ConstantInt::get(ITy, CmpInst::isTrueWhenEqual(Pred)); in SimplifyICmpInst()
2529 (CmpInst::isUnsigned(Pred) && LBO->hasNoUnsignedWrap()) || in SimplifyICmpInst()
2530 (CmpInst::isSigned(Pred) && LBO->hasNoSignedWrap()); in SimplifyICmpInst()
2535 (CmpInst::isUnsigned(Pred) && RBO->hasNoUnsignedWrap()) || in SimplifyICmpInst()
2536 (CmpInst::isSigned(Pred) && RBO->hasNoSignedWrap()); in SimplifyICmpInst()
2616 if (!CmpInst::isUnsigned(Pred) && match(LHS, m_Neg(m_ZExt(m_Value())))) { in SimplifyICmpInst()
2777 CmpInst::Predicate P = CmpInst::BAD_ICMP_PREDICATE; in SimplifyICmpInst()
2778 CmpInst::Predicate EqP; // Chosen so that "A == max/min(A,B)" iff "A EqP B". in SimplifyICmpInst()
2783 EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B". in SimplifyICmpInst()
2789 EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B". in SimplifyICmpInst()
2791 P = CmpInst::getSwappedPredicate(Pred); in SimplifyICmpInst()
2795 EqP = CmpInst::ICMP_SLE; // "A == smin(A, B)" iff "A sle B". in SimplifyICmpInst()
2798 P = CmpInst::getSwappedPredicate(Pred); in SimplifyICmpInst()
2802 EqP = CmpInst::ICMP_SLE; // "A == smin(A, B)" iff "A sle B". in SimplifyICmpInst()
2807 if (P != CmpInst::BAD_ICMP_PREDICATE) { in SimplifyICmpInst()
2812 case CmpInst::ICMP_EQ: in SimplifyICmpInst()
2813 case CmpInst::ICMP_SLE: in SimplifyICmpInst()
2825 case CmpInst::ICMP_NE: in SimplifyICmpInst()
2826 case CmpInst::ICMP_SGT: { in SimplifyICmpInst()
2827 CmpInst::Predicate InvEqP = CmpInst::getInversePredicate(EqP); in SimplifyICmpInst()
2840 case CmpInst::ICMP_SGE: in SimplifyICmpInst()
2843 case CmpInst::ICMP_SLT: in SimplifyICmpInst()
2850 P = CmpInst::BAD_ICMP_PREDICATE; in SimplifyICmpInst()
2853 EqP = CmpInst::ICMP_UGE; // "A == umax(A, B)" iff "A uge B". in SimplifyICmpInst()
2859 EqP = CmpInst::ICMP_UGE; // "A == umax(A, B)" iff "A uge B". in SimplifyICmpInst()
2861 P = CmpInst::getSwappedPredicate(Pred); in SimplifyICmpInst()
2865 EqP = CmpInst::ICMP_ULE; // "A == umin(A, B)" iff "A ule B". in SimplifyICmpInst()
2868 P = CmpInst::getSwappedPredicate(Pred); in SimplifyICmpInst()
2872 EqP = CmpInst::ICMP_ULE; // "A == umin(A, B)" iff "A ule B". in SimplifyICmpInst()
2877 if (P != CmpInst::BAD_ICMP_PREDICATE) { in SimplifyICmpInst()
2882 case CmpInst::ICMP_EQ: in SimplifyICmpInst()
2883 case CmpInst::ICMP_ULE: in SimplifyICmpInst()
2895 case CmpInst::ICMP_NE: in SimplifyICmpInst()
2896 case CmpInst::ICMP_UGT: { in SimplifyICmpInst()
2897 CmpInst::Predicate InvEqP = CmpInst::getInversePredicate(EqP); in SimplifyICmpInst()
2910 case CmpInst::ICMP_UGE: in SimplifyICmpInst()
2913 case CmpInst::ICMP_ULT: in SimplifyICmpInst()
2925 if (Pred == CmpInst::ICMP_SGE) in SimplifyICmpInst()
2928 if (Pred == CmpInst::ICMP_SLT) in SimplifyICmpInst()
2935 if (Pred == CmpInst::ICMP_SLE) in SimplifyICmpInst()
2938 if (Pred == CmpInst::ICMP_SGT) in SimplifyICmpInst()
2945 if (Pred == CmpInst::ICMP_UGE) in SimplifyICmpInst()
2948 if (Pred == CmpInst::ICMP_ULT) in SimplifyICmpInst()
2955 if (Pred == CmpInst::ICMP_ULE) in SimplifyICmpInst()
2958 if (Pred == CmpInst::ICMP_UGT) in SimplifyICmpInst()
3037 CmpInst::Predicate Pred = (CmpInst::Predicate)Predicate; in SimplifyFCmpInst()
3038 assert(CmpInst::isFPPredicate(Pred) && "Not an FP compare!"); in SimplifyFCmpInst()
3046 Pred = CmpInst::getSwappedPredicate(Pred); in SimplifyFCmpInst()
3060 return ConstantInt::get(GetCompareTy(LHS), CmpInst::isUnordered(Pred)); in SimplifyFCmpInst()
3065 if (CmpInst::isTrueWhenEqual(Pred)) in SimplifyFCmpInst()
3067 if (CmpInst::isFalseWhenEqual(Pred)) in SimplifyFCmpInst()
3532 if (CmpInst::isIntPredicate((CmpInst::Predicate)Predicate)) in SimplifyCmpInst()