[PATCH] D129753: [SCEV] Prove condition invariance via context

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 21:11:49 PDT 2022


mkazantsev added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:10816-10817
+    assert(ArLHS->hasNoUnsignedWrap() && "Is a requirement of monotonicity!");
+    // If we can prove that ArLHS <s RHS, and RHS >=s 0, and we know that ArLHS
+    // does not cross zero, there are two options:
+    // - ArLHS is always negative. It means that ArLHS <u RHS is always false;
----------------
apilipenko wrote:
> > we know that ArLHS does not cross zero
> 
> Where do you get this fact from?
> 
> 
> 
"Does not cross zero" is "hasNoUnsignedWrap", we got it from
```
  auto MonotonicType = getMonotonicPredicateType(ArLHS, Pred);
```
and assert just here.


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

https://reviews.llvm.org/D129753



More information about the llvm-commits mailing list