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

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 11:14:18 PDT 2020


reames requested changes to this revision.
reames added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:10158
+      const SCEV *MinusOne = getNegativeSCEV(getOne(LHS->getType()));
+      if (isImpliedCondOperands(ICmpInst::ICMP_SGT, LHS, MinusOne, FoundLHS,
+                                FoundRHS) &&
----------------
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);
}


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

https://reviews.llvm.org/D88087



More information about the llvm-commits mailing list