Lines Matching refs:CmpInst
91 CmpInst::Predicate Pred;
96 : Pred(CmpInst::BAD_ICMP_PREDICATE), Op0(nullptr), Op1(nullptr) {} in ConditionTy()
97 ConditionTy(CmpInst::Predicate Pred, Value *Op0, Value *Op1) in ConditionTy()
135 : U(U), DoesHold(CmpInst::BAD_ICMP_PREDICATE, nullptr, nullptr), in FactOrCheck()
139 FactOrCheck(DomTreeNode *DTN, CmpInst::Predicate Pred, Value *Op0, Value *Op1, in FactOrCheck()
144 static FactOrCheck getConditionFact(DomTreeNode *DTN, CmpInst::Predicate Pred, in getConditionFact()
307 bool doesHold(CmpInst::Predicate Pred, Value *A, Value *B) const;
309 void addFact(CmpInst::Predicate Pred, Value *A, Value *B, unsigned NumIn,
316 ConstraintTy getConstraint(CmpInst::Predicate Pred, Value *Op0, Value *Op1,
326 ConstraintTy getConstraintForSolving(CmpInst::Predicate Pred, Value *Op0,
331 void transferToOtherSystem(CmpInst::Predicate Pred, Value *A, Value *B,
466 Preconditions.emplace_back(CmpInst::ICMP_SGE, Index, in decomposeGEP()
560 Preconditions.emplace_back(CmpInst::ICMP_SGE, Op0, in decompose()
571 Preconditions.emplace_back(CmpInst::ICMP_SGE, Op0, in decompose()
574 Preconditions.emplace_back(CmpInst::ICMP_SGE, Op1, in decompose()
583 CmpInst::ICMP_UGE, Op0, in decompose()
618 ConstraintInfo::getConstraint(CmpInst::Predicate Pred, Value *Op0, Value *Op1, in getConstraint()
626 case CmpInst::ICMP_UGT: in getConstraint()
627 case CmpInst::ICMP_UGE: in getConstraint()
628 case CmpInst::ICMP_SGT: in getConstraint()
629 case CmpInst::ICMP_SGE: { in getConstraint()
630 Pred = CmpInst::getSwappedPredicate(Pred); in getConstraint()
634 case CmpInst::ICMP_EQ: in getConstraint()
636 Pred = CmpInst::ICMP_ULE; in getConstraint()
639 Pred = CmpInst::ICMP_ULE; in getConstraint()
642 case CmpInst::ICMP_NE: in getConstraint()
644 Pred = CmpInst::getSwappedPredicate(CmpInst::ICMP_UGT); in getConstraint()
648 Pred = CmpInst::ICMP_ULE; in getConstraint()
655 if (Pred != CmpInst::ICMP_ULE && Pred != CmpInst::ICMP_ULT && in getConstraint()
656 Pred != CmpInst::ICMP_SLE && Pred != CmpInst::ICMP_SLT) in getConstraint()
660 bool IsSigned = CmpInst::isSigned(Pred); in getConstraint()
720 if (Pred == (IsSigned ? CmpInst::ICMP_SLT : CmpInst::ICMP_ULT)) in getConstraint()
749 ConstraintTy ConstraintInfo::getConstraintForSolving(CmpInst::Predicate Pred, in getConstraintForSolving()
755 if ((Pred == CmpInst::ICMP_ULE && Op0 == NullC) || in getConstraintForSolving()
756 (Pred == CmpInst::ICMP_UGE && Op1 == NullC)) { in getConstraintForSolving()
766 if (CmpInst::isSigned(Pred) && in getConstraintForSolving()
769 Pred = CmpInst::getUnsignedPredicate(Pred); in getConstraintForSolving()
829 bool ConstraintInfo::doesHold(CmpInst::Predicate Pred, Value *A, in doesHold()
837 CmpInst::Predicate Pred, Value *A, Value *B, unsigned NumIn, in transferToOtherSystem()
840 return doesHold(CmpInst::ICMP_SGE, V, ConstantInt::get(V->getType(), 0)) || in transferToOtherSystem()
853 case CmpInst::ICMP_ULT: in transferToOtherSystem()
854 case CmpInst::ICMP_ULE: in transferToOtherSystem()
857 addFact(CmpInst::ICMP_SGE, A, ConstantInt::get(B->getType(), 0), NumIn, in transferToOtherSystem()
859 addFact(CmpInst::getSignedPredicate(Pred), A, B, NumIn, NumOut, in transferToOtherSystem()
863 case CmpInst::ICMP_UGE: in transferToOtherSystem()
864 case CmpInst::ICMP_UGT: in transferToOtherSystem()
867 addFact(CmpInst::ICMP_SGE, B, ConstantInt::get(B->getType(), 0), NumIn, in transferToOtherSystem()
869 addFact(CmpInst::getSignedPredicate(Pred), A, B, NumIn, NumOut, in transferToOtherSystem()
873 case CmpInst::ICMP_SLT: in transferToOtherSystem()
875 addFact(CmpInst::ICMP_ULT, A, B, NumIn, NumOut, DFSInStack); in transferToOtherSystem()
877 case CmpInst::ICMP_SGT: { in transferToOtherSystem()
878 if (doesHold(CmpInst::ICMP_SGE, B, ConstantInt::get(B->getType(), -1))) in transferToOtherSystem()
879 addFact(CmpInst::ICMP_UGE, A, ConstantInt::get(B->getType(), 0), NumIn, in transferToOtherSystem()
882 addFact(CmpInst::ICMP_UGT, A, B, NumIn, NumOut, DFSInStack); in transferToOtherSystem()
886 case CmpInst::ICMP_SGE: in transferToOtherSystem()
888 addFact(CmpInst::ICMP_UGE, A, B, NumIn, NumOut, DFSInStack); in transferToOtherSystem()
910 CmpInst::Predicate Pred; in addInfoForInductions()
917 Pred = CmpInst::getSwappedPredicate(Pred); in addInfoForInductions()
927 if (Pred == CmpInst::ICMP_NE) in addInfoForInductions()
929 else if (Pred == CmpInst::ICMP_EQ) in addInfoForInductions()
952 auto IncUnsigned = SE.getMonotonicPredicateType(AR, CmpInst::ICMP_UGT); in addInfoForInductions()
953 auto IncSigned = SE.getMonotonicPredicateType(AR, CmpInst::ICMP_SGT); in addInfoForInductions()
962 FactOrCheck::getConditionFact(DTN, CmpInst::ICMP_UGE, PN, StartValue)); in addInfoForInductions()
965 FactOrCheck::getConditionFact(DTN, CmpInst::ICMP_SGE, PN, StartValue)); in addInfoForInductions()
987 DTN, CmpInst::ICMP_UGE, StartValue, PN, in addInfoForInductions()
988 ConditionTy(CmpInst::ICMP_ULE, B, StartValue))); in addInfoForInductions()
990 DTN, CmpInst::ICMP_SGE, StartValue, PN, in addInfoForInductions()
991 ConditionTy(CmpInst::ICMP_SLE, B, StartValue))); in addInfoForInductions()
995 DTN, CmpInst::ICMP_UGT, PN, B, in addInfoForInductions()
996 ConditionTy(CmpInst::ICMP_ULE, B, StartValue))); in addInfoForInductions()
998 DTN, CmpInst::ICMP_SGT, PN, B, in addInfoForInductions()
999 ConditionTy(CmpInst::ICMP_SLE, B, StartValue))); in addInfoForInductions()
1022 DTN, CmpInst::ICMP_UGE, PN, StartValue, in addInfoForInductions()
1023 ConditionTy(CmpInst::ICMP_ULE, StartValue, B))); in addInfoForInductions()
1026 DTN, CmpInst::ICMP_SGE, PN, StartValue, in addInfoForInductions()
1027 ConditionTy(CmpInst::ICMP_SLE, StartValue, B))); in addInfoForInductions()
1030 DTN, CmpInst::ICMP_ULT, PN, B, in addInfoForInductions()
1031 ConditionTy(CmpInst::ICMP_ULE, StartValue, B))); in addInfoForInductions()
1033 DTN, CmpInst::ICMP_SLT, PN, B, in addInfoForInductions()
1034 ConditionTy(CmpInst::ICMP_SLE, StartValue, B))); in addInfoForInductions()
1040 assert((Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_NE) && in addInfoForInductions()
1042 ConditionTy Precond = {CmpInst::ICMP_ULE, StartValue, B}; in addInfoForInductions()
1049 DT.getNode(EB), CmpInst::ICMP_ULE, A, B, Precond)); in addInfoForInductions()
1077 CmpInst::Predicate Pred; in addInfoFor()
1126 DT.getNode(Succ), CmpInst::ICMP_EQ, Switch->getCondition(), V)); in addInfoFor()
1164 IsOr ? CmpInst::getInversePredicate(Cmp->getPredicate()) in addInfoFor()
1194 CmpInst::getInversePredicate(CmpI->getPredicate()), CmpI->getOperand(0), in addInfoFor()
1230 static void generateReproducer(CmpInst *Cond, Module *M, in generateReproducer()
1262 !isa<CmpInst, BinaryOperator, GEPOperator, CastInst>(V)) { in generateReproducer()
1343 CloneInstructions({Entry.LHS, Entry.RHS}, CmpInst::isSigned(Entry.Pred)); in generateReproducer()
1351 CloneInstructions(Cond, CmpInst::isSigned(Cond->getPredicate())); in generateReproducer()
1358 static std::optional<bool> checkCondition(CmpInst::Predicate Pred, Value *A, in checkCondition()
1388 dbgs(), *ImpliedCondition ? Pred : CmpInst::getInversePredicate(Pred), in checkCondition()
1400 CmpInst *Cmp, ConstraintInfo &Info, unsigned NumIn, unsigned NumOut, in checkAndReplaceCondition()
1404 auto ReplaceCmpWithConstant = [&](CmpInst *Cmp, bool IsTrue) { in checkAndReplaceCondition()
1407 CmpInst::makeCmpResultType(Cmp->getType()), IsTrue); in checkAndReplaceCondition()
1501 CmpInst::Predicate Pred; in checkOrAndOpImpliedByOther()
1504 CmpInst *CmpToCheck = cast<CmpInst>(CB.getInstructionToSimplify()); in checkOrAndOpImpliedByOther()
1520 Pred = CmpInst::getInversePredicate(Pred); in checkOrAndOpImpliedByOther()
1554 void ConstraintInfo::addFact(CmpInst::Predicate Pred, Value *A, Value *B, in addFact()
1652 auto DoesConditionHold = [](CmpInst::Predicate Pred, Value *A, Value *B, in tryToSimplifyOverflowMath()
1668 if (!DoesConditionHold(CmpInst::ICMP_SGE, A, B, Info) || in tryToSimplifyOverflowMath()
1669 !DoesConditionHold(CmpInst::ICMP_SGE, B, in tryToSimplifyOverflowMath()
1786 auto AddFact = [&](CmpInst::Predicate Pred, Value *A, Value *B) { in eliminateConstraints()
1789 if (Info.getCS(CmpInst::isSigned(Pred)).size() > MaxRows) { in eliminateConstraints()
1819 AddFact(CmpInst::ICMP_SGE, CB.Inst, in eliminateConstraints()
1821 AddFact(CmpInst::ICMP_SGE, CB.Inst, X); in eliminateConstraints()
1838 if (CB.DoesHold.Pred != CmpInst::BAD_ICMP_PREDICATE && in eliminateConstraints()