Lines Matching refs:CmpInst

90   CmpInst::Predicate Pred;
95 : Pred(CmpInst::BAD_ICMP_PREDICATE), Op0(nullptr), Op1(nullptr) {} in ConditionTy()
96 ConditionTy(CmpInst::Predicate Pred, Value *Op0, Value *Op1) in ConditionTy()
134 : U(U), DoesHold(CmpInst::BAD_ICMP_PREDICATE, nullptr, nullptr), in FactOrCheck()
138 FactOrCheck(DomTreeNode *DTN, CmpInst::Predicate Pred, Value *Op0, Value *Op1, in FactOrCheck()
143 static FactOrCheck getConditionFact(DomTreeNode *DTN, CmpInst::Predicate Pred, in getConditionFact()
306 bool doesHold(CmpInst::Predicate Pred, Value *A, Value *B) const;
308 void addFact(CmpInst::Predicate Pred, Value *A, Value *B, unsigned NumIn,
315 ConstraintTy getConstraint(CmpInst::Predicate Pred, Value *Op0, Value *Op1,
325 ConstraintTy getConstraintForSolving(CmpInst::Predicate Pred, Value *Op0,
330 void transferToOtherSystem(CmpInst::Predicate Pred, Value *A, Value *B,
465 Preconditions.emplace_back(CmpInst::ICMP_SGE, Index, in decomposeGEP()
555 Preconditions.emplace_back(CmpInst::ICMP_SGE, Op0, in decompose()
558 Preconditions.emplace_back(CmpInst::ICMP_SGE, Op1, in decompose()
567 CmpInst::ICMP_UGE, Op0, in decompose()
602 ConstraintInfo::getConstraint(CmpInst::Predicate Pred, Value *Op0, Value *Op1, in getConstraint()
610 case CmpInst::ICMP_UGT: in getConstraint()
611 case CmpInst::ICMP_UGE: in getConstraint()
612 case CmpInst::ICMP_SGT: in getConstraint()
613 case CmpInst::ICMP_SGE: { in getConstraint()
614 Pred = CmpInst::getSwappedPredicate(Pred); in getConstraint()
618 case CmpInst::ICMP_EQ: in getConstraint()
620 Pred = CmpInst::ICMP_ULE; in getConstraint()
623 Pred = CmpInst::ICMP_ULE; in getConstraint()
626 case CmpInst::ICMP_NE: in getConstraint()
628 Pred = CmpInst::getSwappedPredicate(CmpInst::ICMP_UGT); in getConstraint()
632 Pred = CmpInst::ICMP_ULE; in getConstraint()
639 if (Pred != CmpInst::ICMP_ULE && Pred != CmpInst::ICMP_ULT && in getConstraint()
640 Pred != CmpInst::ICMP_SLE && Pred != CmpInst::ICMP_SLT) in getConstraint()
644 bool IsSigned = CmpInst::isSigned(Pred); in getConstraint()
704 if (Pred == (IsSigned ? CmpInst::ICMP_SLT : CmpInst::ICMP_ULT)) in getConstraint()
733 ConstraintTy ConstraintInfo::getConstraintForSolving(CmpInst::Predicate Pred, in getConstraintForSolving()
739 if ((Pred == CmpInst::ICMP_ULE && Op0 == NullC) || in getConstraintForSolving()
740 (Pred == CmpInst::ICMP_UGE && Op1 == NullC)) { in getConstraintForSolving()
750 if (CmpInst::isSigned(Pred) && in getConstraintForSolving()
753 Pred = CmpInst::getUnsignedPredicate(Pred); in getConstraintForSolving()
813 bool ConstraintInfo::doesHold(CmpInst::Predicate Pred, Value *A, in doesHold()
821 CmpInst::Predicate Pred, Value *A, Value *B, unsigned NumIn, in transferToOtherSystem()
824 return doesHold(CmpInst::ICMP_SGE, V, ConstantInt::get(V->getType(), 0)) || in transferToOtherSystem()
837 case CmpInst::ICMP_ULT: in transferToOtherSystem()
838 case CmpInst::ICMP_ULE: in transferToOtherSystem()
841 addFact(CmpInst::ICMP_SGE, A, ConstantInt::get(B->getType(), 0), NumIn, in transferToOtherSystem()
843 addFact(CmpInst::getSignedPredicate(Pred), A, B, NumIn, NumOut, in transferToOtherSystem()
847 case CmpInst::ICMP_UGE: in transferToOtherSystem()
848 case CmpInst::ICMP_UGT: in transferToOtherSystem()
851 addFact(CmpInst::ICMP_SGE, B, ConstantInt::get(B->getType(), 0), NumIn, in transferToOtherSystem()
853 addFact(CmpInst::getSignedPredicate(Pred), A, B, NumIn, NumOut, in transferToOtherSystem()
857 case CmpInst::ICMP_SLT: in transferToOtherSystem()
859 addFact(CmpInst::ICMP_ULT, A, B, NumIn, NumOut, DFSInStack); in transferToOtherSystem()
861 case CmpInst::ICMP_SGT: { in transferToOtherSystem()
862 if (doesHold(CmpInst::ICMP_SGE, B, ConstantInt::get(B->getType(), -1))) in transferToOtherSystem()
863 addFact(CmpInst::ICMP_UGE, A, ConstantInt::get(B->getType(), 0), NumIn, in transferToOtherSystem()
866 addFact(CmpInst::ICMP_UGT, A, B, NumIn, NumOut, DFSInStack); in transferToOtherSystem()
870 case CmpInst::ICMP_SGE: in transferToOtherSystem()
872 addFact(CmpInst::ICMP_UGE, A, B, NumIn, NumOut, DFSInStack); in transferToOtherSystem()
894 CmpInst::Predicate Pred; in addInfoForInductions()
901 Pred = CmpInst::getSwappedPredicate(Pred); in addInfoForInductions()
911 if (Pred == CmpInst::ICMP_NE) in addInfoForInductions()
913 else if (Pred == CmpInst::ICMP_EQ) in addInfoForInductions()
936 auto IncUnsigned = SE.getMonotonicPredicateType(AR, CmpInst::ICMP_UGT); in addInfoForInductions()
937 auto IncSigned = SE.getMonotonicPredicateType(AR, CmpInst::ICMP_SGT); in addInfoForInductions()
946 FactOrCheck::getConditionFact(DTN, CmpInst::ICMP_UGE, PN, StartValue)); in addInfoForInductions()
949 FactOrCheck::getConditionFact(DTN, CmpInst::ICMP_SGE, PN, StartValue)); in addInfoForInductions()
971 DTN, CmpInst::ICMP_UGE, StartValue, PN, in addInfoForInductions()
972 ConditionTy(CmpInst::ICMP_ULE, B, StartValue))); in addInfoForInductions()
974 DTN, CmpInst::ICMP_SGE, StartValue, PN, in addInfoForInductions()
975 ConditionTy(CmpInst::ICMP_SLE, B, StartValue))); in addInfoForInductions()
979 DTN, CmpInst::ICMP_UGT, PN, B, in addInfoForInductions()
980 ConditionTy(CmpInst::ICMP_ULE, B, StartValue))); in addInfoForInductions()
982 DTN, CmpInst::ICMP_SGT, PN, B, in addInfoForInductions()
983 ConditionTy(CmpInst::ICMP_SLE, B, StartValue))); in addInfoForInductions()
1006 DTN, CmpInst::ICMP_UGE, PN, StartValue, in addInfoForInductions()
1007 ConditionTy(CmpInst::ICMP_ULE, StartValue, B))); in addInfoForInductions()
1010 DTN, CmpInst::ICMP_SGE, PN, StartValue, in addInfoForInductions()
1011 ConditionTy(CmpInst::ICMP_SLE, StartValue, B))); in addInfoForInductions()
1014 DTN, CmpInst::ICMP_ULT, PN, B, in addInfoForInductions()
1015 ConditionTy(CmpInst::ICMP_ULE, StartValue, B))); in addInfoForInductions()
1017 DTN, CmpInst::ICMP_SLT, PN, B, in addInfoForInductions()
1018 ConditionTy(CmpInst::ICMP_SLE, StartValue, B))); in addInfoForInductions()
1044 CmpInst::Predicate Pred; in addInfoFor()
1088 DT.getNode(Succ), CmpInst::ICMP_EQ, Switch->getCondition(), V)); in addInfoFor()
1126 IsOr ? CmpInst::getInversePredicate(Cmp->getPredicate()) in addInfoFor()
1156 CmpInst::getInversePredicate(CmpI->getPredicate()), CmpI->getOperand(0), in addInfoFor()
1192 static void generateReproducer(CmpInst *Cond, Module *M, in generateReproducer()
1224 !isa<CmpInst, BinaryOperator, GEPOperator, CastInst>(V)) { in generateReproducer()
1305 CloneInstructions({Entry.LHS, Entry.RHS}, CmpInst::isSigned(Entry.Pred)); in generateReproducer()
1313 CloneInstructions(Cond, CmpInst::isSigned(Cond->getPredicate())); in generateReproducer()
1320 static std::optional<bool> checkCondition(CmpInst::Predicate Pred, Value *A, in checkCondition()
1350 dbgs(), *ImpliedCondition ? Pred : CmpInst::getInversePredicate(Pred), in checkCondition()
1362 CmpInst *Cmp, ConstraintInfo &Info, unsigned NumIn, unsigned NumOut, in checkAndReplaceCondition()
1366 auto ReplaceCmpWithConstant = [&](CmpInst *Cmp, bool IsTrue) { in checkAndReplaceCondition()
1369 CmpInst::makeCmpResultType(Cmp->getType()), IsTrue); in checkAndReplaceCondition()
1421 CmpInst::Predicate Pred; in checkOrAndOpImpliedByOther()
1424 CmpInst *CmpToCheck = cast<CmpInst>(CB.getInstructionToSimplify()); in checkOrAndOpImpliedByOther()
1440 Pred = CmpInst::getInversePredicate(Pred); in checkOrAndOpImpliedByOther()
1474 void ConstraintInfo::addFact(CmpInst::Predicate Pred, Value *A, Value *B, in addFact()
1572 auto DoesConditionHold = [](CmpInst::Predicate Pred, Value *A, Value *B, in tryToSimplifyOverflowMath()
1588 if (!DoesConditionHold(CmpInst::ICMP_SGE, A, B, Info) || in tryToSimplifyOverflowMath()
1589 !DoesConditionHold(CmpInst::ICMP_SGE, B, in tryToSimplifyOverflowMath()
1702 auto AddFact = [&](CmpInst::Predicate Pred, Value *A, Value *B) { in eliminateConstraints()
1705 if (Info.getCS(CmpInst::isSigned(Pred)).size() > MaxRows) { in eliminateConstraints()
1734 AddFact(CmpInst::ICMP_SGE, CB.Inst, X); in eliminateConstraints()
1751 if (CB.DoesHold.Pred != CmpInst::BAD_ICMP_PREDICATE && in eliminateConstraints()