Lines Matching defs:FoundRHS
11778 const SCEV *FoundRHS = getSCEV(ICI->getOperand(1));
11780 return isImpliedCond(Pred, LHS, RHS, FoundPred, FoundLHS, FoundRHS, CtxI);
11785 const SCEV *FoundLHS, const SCEV *FoundRHS,
11794 !FoundRHS->getType()->isPointerTy()) {
11802 isKnownViaNonRecursiveReasoning(ICmpInst::ICMP_ULE, FoundRHS,
11805 const SCEV *TruncFoundRHS = getTruncateExpr(FoundRHS, NarrowType);
11823 if (FoundLHS->getType()->isPointerTy() || FoundRHS->getType()->isPointerTy())
11827 FoundRHS = getSignExtendExpr(FoundRHS, LHS->getType());
11830 FoundRHS = getZeroExtendExpr(FoundRHS, LHS->getType());
11834 FoundRHS, CtxI);
11839 const SCEV *FoundLHS, const SCEV *FoundRHS, const Instruction *CtxI) {
11848 if (SimplifyICmpOperands(FoundPred, FoundLHS, FoundRHS))
11849 if (FoundLHS == FoundRHS)
11853 if (LHS == FoundRHS || RHS == FoundLHS) {
11855 std::swap(FoundLHS, FoundRHS);
11866 return isImpliedCondOperands(Pred, LHS, RHS, FoundLHS, FoundRHS, CtxI);
11874 // 0. LHS Pred RHS <- FoundLHS SwapPred FoundRHS
11876 // 1. LHS Pred RHS <- FoundRHS Pred FoundLHS
11877 // 2. RHS SwapPred LHS <- FoundLHS SwapPred FoundRHS
11878 // 3. LHS Pred RHS <- ~FoundLHS Pred ~FoundRHS
11879 // 4. ~LHS SwapPred ~RHS <- FoundLHS SwapPred FoundRHS
11883 return isImpliedCondOperands(FoundPred, RHS, LHS, FoundLHS, FoundRHS,
11885 if (!isa<SCEVConstant>(FoundRHS) && !isa<SCEVAddRecExpr>(FoundLHS))
11886 return isImpliedCondOperands(Pred, LHS, RHS, FoundRHS, FoundLHS, CtxI);
11893 FoundLHS, FoundRHS, CtxI))
11897 !FoundRHS->getType()->isPointerTy() &&
11899 getNotSCEV(FoundRHS), CtxI))
11914 if ((isKnownNonNegative(FoundLHS) && isKnownNonNegative(FoundRHS)) ||
11915 (isKnownNegative(FoundLHS) && isKnownNegative(FoundRHS)))
11916 return isImpliedCondOperands(Pred, LHS, RHS, FoundLHS, FoundRHS, CtxI);
11921 *CanonicalFoundLHS = FoundLHS, *CanonicalFoundRHS = FoundRHS;
11951 (isa<SCEVConstant>(FoundLHS) || isa<SCEVConstant>(FoundRHS))) {
11958 V = FoundRHS;
11960 C = cast<SCEVConstant>(FoundRHS);
12029 if (isImpliedCondOperands(Pred, LHS, RHS, FoundLHS, FoundRHS, CtxI))
12033 if (isImpliedCondOperands(FoundPred, LHS, RHS, FoundLHS, FoundRHS, CtxI))
12036 if (isImpliedCondOperandsViaRanges(Pred, LHS, RHS, FoundPred, FoundLHS, FoundRHS))
12175 const SCEV *FoundRHS, const Instruction *CtxI) {
12178 // FoundRHS = ...
12183 // known(Pred, FoundLHS, FoundRHS)
12187 // this case, `FoundLHS Pred FoundRHS` implies `Start Pred FoundRHS`. Try to
12199 if (!isAvailableAtLoopEntry(FoundRHS, AR->getLoop()))
12201 return isImpliedCondOperands(Pred, LHS, RHS, AR->getStart(), FoundRHS);
12204 if (auto *AR = dyn_cast<SCEVAddRecExpr>(FoundRHS)) {
12222 const SCEV *FoundRHS) {
12242 // FoundLHS u< FoundRHS u< -C => (FoundLHS + C) u< (FoundRHS + C) ... (1)
12244 // FoundLHS s< FoundRHS s< INT_MIN - C => (FoundLHS + C) s< (FoundRHS + C)
12253 // FoundLHS s< FoundRHS s< INT_MIN - C
12254 // <=> (FoundLHS + INT_MIN) u< (FoundRHS + INT_MIN) u< -C [ using (3) ]
12255 // <=> (FoundLHS + INT_MIN + C) u< (FoundRHS + INT_MIN + C) [ using (1) ]
12257 // (FoundRHS + INT_MIN + C + INT_MIN) [ using (3) ]
12258 // <=> FoundLHS + C s< FoundRHS + C
12267 // Despite (2), "FoundRHS s< INT_MIN - C" does not mean that "FoundRHS + C"
12268 // will not sign underflow. For instance, say FoundLHS = (i8 -128), FoundRHS
12269 // = (i8 -127) and C = (i8 -100). Then INT_MIN - C = (i8 -28), and FoundRHS
12270 // s< (INT_MIN - C). Lack of sign overflow / underflow in "FoundRHS + C" is
12271 // neither necessary nor sufficient to prove "(FoundLHS + C) s< (FoundRHS +
12277 std::optional<APInt> RDiff = computeConstantDifference(RHS, FoundRHS);
12294 return isAvailableAtLoopEntry(FoundRHS, L) &&
12295 isLoopEntryGuardedByCond(L, Pred, FoundRHS,
12301 const SCEV *FoundRHS, unsigned Depth) {
12346 std::swap(FoundLHS, FoundRHS);
12357 isImpliedCondOperandsViaRanges(Pred, S1, S2, Pred, FoundLHS, FoundRHS) ||
12358 isImpliedViaOperations(Pred, S1, S2, FoundLHS, FoundRHS, Depth);
12416 const SCEV *FoundRHS) {
12419 if (RHS == FoundRHS) {
12421 std::swap(FoundLHS, FoundRHS);
12427 auto *SUFoundRHS = dyn_cast<SCEVUnknown>(FoundRHS);
12457 const SCEV *FoundRHS,
12459 if (isImpliedCondOperandsViaRanges(Pred, LHS, RHS, Pred, FoundLHS, FoundRHS))
12462 if (isImpliedCondOperandsViaNoOverflow(Pred, LHS, RHS, FoundLHS, FoundRHS))
12465 if (isImpliedCondOperandsViaShift(Pred, LHS, RHS, FoundLHS, FoundRHS))
12468 if (isImpliedCondOperandsViaAddRecStart(Pred, LHS, RHS, FoundLHS, FoundRHS,
12473 FoundLHS, FoundRHS);
12555 const SCEV *FoundRHS,
12561 getTypeSizeInBits(FoundRHS->getType()) &&
12562 "FoundLHS and FoundRHS have different sizes?");
12571 std::swap(FoundLHS, FoundRHS);
12579 if (isKnownNonNegative(FoundLHS) && isKnownNonNegative(FoundRHS)) {
12580 // Knowing that both FoundLHS and FoundRHS are non-negative, and knowing
12581 // FoundLHS >u FoundRHS, we also know that FoundLHS >s FoundRHS. Let us
12585 FoundRHS) &&
12587 FoundRHS))
12612 FoundRHS, Depth + 1);
12673 auto *FRHSTy = FoundRHS->getType();
12682 // FoundLHS > FoundRHS, LHS = FoundLHS / Denominator, Denominator > 0.
12685 auto *FoundRHSExt = getNoopOrSignExtend(FoundRHS, WTy);
12688 // (FoundRHS > Denominator - 2) && (RHS <= 0) => (LHS > RHS).
12697 // (FoundRHS > -1 - Denominator) && (RHS < 0) => (LHS > RHS).
12714 if (isImpliedViaMerge(Pred, OrigLHS, RHS, OrigFoundLHS, FoundRHS, Depth + 1))
12761 const SCEV *FoundRHS) {
12767 if (HasSameValue(LHS, FoundLHS) && HasSameValue(RHS, FoundRHS))
12773 isKnownViaNonRecursiveReasoning(ICmpInst::ICMP_SGE, RHS, FoundRHS))
12779 isKnownViaNonRecursiveReasoning(ICmpInst::ICMP_SLE, RHS, FoundRHS))
12785 isKnownViaNonRecursiveReasoning(ICmpInst::ICMP_UGE, RHS, FoundRHS))
12791 isKnownViaNonRecursiveReasoning(ICmpInst::ICMP_ULE, RHS, FoundRHS))
12797 if (isImpliedViaOperations(Pred, LHS, RHS, FoundLHS, FoundRHS))
12805 const SCEV *FoundLHS, const SCEV *FoundRHS) {
12806 if (!isa<SCEVConstant>(RHS) || !isa<SCEVConstant>(FoundRHS))
12807 // The restriction on `FoundRHS` be lifted easily -- it exists only to
12815 const APInt &ConstFoundRHS = cast<SCEVConstant>(FoundRHS)->getAPInt();
12818 // antecedent "`FoundLHS` `FoundPred` `FoundRHS`".