Lines Matching defs:FoundRHS

11667   const SCEV *FoundRHS = getSCEV(ICI->getOperand(1));
11669 return isImpliedCond(Pred, LHS, RHS, FoundPred, FoundLHS, FoundRHS, CtxI);
11675 const SCEV *FoundLHS, const SCEV *FoundRHS,
11684 !FoundRHS->getType()->isPointerTy()) {
11692 isKnownViaNonRecursiveReasoning(ICmpInst::ICMP_ULE, FoundRHS,
11695 const SCEV *TruncFoundRHS = getTruncateExpr(FoundRHS, NarrowType);
11713 if (FoundLHS->getType()->isPointerTy() || FoundRHS->getType()->isPointerTy())
11717 FoundRHS = getSignExtendExpr(FoundRHS, LHS->getType());
11720 FoundRHS = getZeroExtendExpr(FoundRHS, LHS->getType());
11724 FoundRHS, CtxI);
11729 ICmpInst::Predicate FoundPred, const SCEV *FoundLHS, const SCEV *FoundRHS,
11739 if (SimplifyICmpOperands(FoundPred, FoundLHS, FoundRHS))
11740 if (FoundLHS == FoundRHS)
11744 if (LHS == FoundRHS || RHS == FoundLHS) {
11746 std::swap(FoundLHS, FoundRHS);
11756 return isImpliedCondOperands(Pred, LHS, RHS, FoundLHS, FoundRHS, CtxI);
11762 // 0. LHS Pred RHS <- FoundLHS SwapPred FoundRHS
11764 // 1. LHS Pred RHS <- FoundRHS Pred FoundLHS
11765 // 2. RHS SwapPred LHS <- FoundLHS SwapPred FoundRHS
11766 // 3. LHS Pred RHS <- ~FoundLHS Pred ~FoundRHS
11767 // 4. ~LHS SwapPred ~RHS <- FoundLHS SwapPred FoundRHS
11771 return isImpliedCondOperands(FoundPred, RHS, LHS, FoundLHS, FoundRHS,
11773 if (!isa<SCEVConstant>(FoundRHS) && !isa<SCEVAddRecExpr>(FoundLHS))
11774 return isImpliedCondOperands(Pred, LHS, RHS, FoundRHS, FoundLHS, CtxI);
11781 FoundLHS, FoundRHS, CtxI))
11785 !FoundRHS->getType()->isPointerTy() &&
11787 getNotSCEV(FoundRHS), CtxI))
11802 if ((isKnownNonNegative(FoundLHS) && isKnownNonNegative(FoundRHS)) ||
11803 (isKnownNegative(FoundLHS) && isKnownNegative(FoundRHS)))
11804 return isImpliedCondOperands(Pred, LHS, RHS, FoundLHS, FoundRHS, CtxI);
11809 *CanonicalFoundLHS = FoundLHS, *CanonicalFoundRHS = FoundRHS;
11839 (isa<SCEVConstant>(FoundLHS) || isa<SCEVConstant>(FoundRHS))) {
11846 V = FoundRHS;
11848 C = cast<SCEVConstant>(FoundRHS);
11917 if (isImpliedCondOperands(Pred, LHS, RHS, FoundLHS, FoundRHS, CtxI))
11921 if (isImpliedCondOperands(FoundPred, LHS, RHS, FoundLHS, FoundRHS, CtxI))
11924 if (isImpliedCondOperandsViaRanges(Pred, LHS, RHS, FoundPred, FoundLHS, FoundRHS))
12005 const SCEV *FoundLHS, const SCEV *FoundRHS, const Instruction *CtxI) {
12008 // FoundRHS = ...
12013 // known(Pred, FoundLHS, FoundRHS)
12017 // this case, `FoundLHS Pred FoundRHS` implies `Start Pred FoundRHS`. Try to
12029 if (!isAvailableAtLoopEntry(FoundRHS, AR->getLoop()))
12031 return isImpliedCondOperands(Pred, LHS, RHS, AR->getStart(), FoundRHS);
12034 if (auto *AR = dyn_cast<SCEVAddRecExpr>(FoundRHS)) {
12050 const SCEV *FoundLHS, const SCEV *FoundRHS) {
12070 // FoundLHS u< FoundRHS u< -C => (FoundLHS + C) u< (FoundRHS + C) ... (1)
12072 // FoundLHS s< FoundRHS s< INT_MIN - C => (FoundLHS + C) s< (FoundRHS + C)
12081 // FoundLHS s< FoundRHS s< INT_MIN - C
12082 // <=> (FoundLHS + INT_MIN) u< (FoundRHS + INT_MIN) u< -C [ using (3) ]
12083 // <=> (FoundLHS + INT_MIN + C) u< (FoundRHS + INT_MIN + C) [ using (1) ]
12085 // (FoundRHS + INT_MIN + C + INT_MIN) [ using (3) ]
12086 // <=> FoundLHS + C s< FoundRHS + C
12095 // Despite (2), "FoundRHS s< INT_MIN - C" does not mean that "FoundRHS + C"
12096 // will not sign underflow. For instance, say FoundLHS = (i8 -128), FoundRHS
12097 // = (i8 -127) and C = (i8 -100). Then INT_MIN - C = (i8 -28), and FoundRHS
12098 // s< (INT_MIN - C). Lack of sign overflow / underflow in "FoundRHS + C" is
12099 // neither necessary nor sufficient to prove "(FoundLHS + C) s< (FoundRHS +
12103 std::optional<APInt> RDiff = computeConstantDifference(RHS, FoundRHS);
12120 return isAvailableAtLoopEntry(FoundRHS, L) &&
12121 isLoopEntryGuardedByCond(L, Pred, FoundRHS,
12128 const SCEV *FoundRHS, unsigned Depth) {
12173 std::swap(FoundLHS, FoundRHS);
12184 isImpliedCondOperandsViaRanges(Pred, S1, S2, Pred, FoundLHS, FoundRHS) ||
12185 isImpliedViaOperations(Pred, S1, S2, FoundLHS, FoundRHS, Depth);
12243 const SCEV *FoundRHS) {
12246 if (RHS == FoundRHS) {
12248 std::swap(FoundLHS, FoundRHS);
12254 auto *SUFoundRHS = dyn_cast<SCEVUnknown>(FoundRHS);
12284 const SCEV *FoundRHS,
12286 if (isImpliedCondOperandsViaRanges(Pred, LHS, RHS, Pred, FoundLHS, FoundRHS))
12289 if (isImpliedCondOperandsViaNoOverflow(Pred, LHS, RHS, FoundLHS, FoundRHS))
12292 if (isImpliedCondOperandsViaShift(Pred, LHS, RHS, FoundLHS, FoundRHS))
12295 if (isImpliedCondOperandsViaAddRecStart(Pred, LHS, RHS, FoundLHS, FoundRHS,
12300 FoundLHS, FoundRHS);
12383 const SCEV *FoundRHS,
12389 getTypeSizeInBits(FoundRHS->getType()) &&
12390 "FoundLHS and FoundRHS have different sizes?");
12399 std::swap(FoundLHS, FoundRHS);
12407 if (isKnownNonNegative(FoundLHS) && isKnownNonNegative(FoundRHS)) {
12408 // Knowing that both FoundLHS and FoundRHS are non-negative, and knowing
12409 // FoundLHS >u FoundRHS, we also know that FoundLHS >s FoundRHS. Let us
12413 FoundRHS) &&
12415 FoundRHS))
12440 FoundRHS, Depth + 1);
12501 auto *FRHSTy = FoundRHS->getType();
12510 // FoundLHS > FoundRHS, LHS = FoundLHS / Denominator, Denominator > 0.
12513 auto *FoundRHSExt = getNoopOrSignExtend(FoundRHS, WTy);
12516 // (FoundRHS > Denominator - 2) && (RHS <= 0) => (LHS > RHS).
12525 // (FoundRHS > -1 - Denominator) && (RHS < 0) => (LHS > RHS).
12542 if (isImpliedViaMerge(Pred, OrigLHS, RHS, OrigFoundLHS, FoundRHS, Depth + 1))
12594 const SCEV *FoundRHS) {
12599 if (HasSameValue(LHS, FoundLHS) && HasSameValue(RHS, FoundRHS))
12605 isKnownViaNonRecursiveReasoning(ICmpInst::ICMP_SGE, RHS, FoundRHS))
12611 isKnownViaNonRecursiveReasoning(ICmpInst::ICMP_SLE, RHS, FoundRHS))
12617 isKnownViaNonRecursiveReasoning(ICmpInst::ICMP_UGE, RHS, FoundRHS))
12623 isKnownViaNonRecursiveReasoning(ICmpInst::ICMP_ULE, RHS, FoundRHS))
12629 if (isImpliedViaOperations(Pred, LHS, RHS, FoundLHS, FoundRHS))
12640 const SCEV *FoundRHS) {
12641 if (!isa<SCEVConstant>(RHS) || !isa<SCEVConstant>(FoundRHS))
12642 // The restriction on `FoundRHS` be lifted easily -- it exists only to
12650 const APInt &ConstFoundRHS = cast<SCEVConstant>(FoundRHS)->getAPInt();
12653 // antecedent "`FoundLHS` `FoundPred` `FoundRHS`".