[PATCH] D88087: [SCEV] Limited support for unsigned preds in isImpliedViaOperations

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 02:17:29 PDT 2020


mkazantsev added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:10158
+      const SCEV *MinusOne = getNegativeSCEV(getOne(LHS->getType()));
+      if (isImpliedCondOperands(ICmpInst::ICMP_SGT, LHS, MinusOne, FoundLHS,
+                                FoundRHS) &&
----------------
reames wrote:
> I'm confused by this check, it seems overly complicated given the comment?  Why is this simply not:
> if (isKnownNonNegative(LHS) && isKnownNonNegative(RHS) &&
>     isKnownNonNegative(FoundLHS) && isKnownNonNegative(FoundRHS)) {
>    Pred = ICmpInst::getSignedPredicate(Pred);
> }
Because non-negativity of LHS and RHS is not known. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88087/new/

https://reviews.llvm.org/D88087



More information about the llvm-commits mailing list