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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 22:38:58 PDT 2022


mkazantsev added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:10815-10829
+    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;
+    // - ArLHS is always non-negative. It means that
+    //     ArLHS <s RHS <=> ArLHS <u RHS.
+    //   We are guarded by ArLHS <s RHS, so unsigned condition is trivially
----------------
apilipenko wrote:
> Suggested slight rewording of the reasoning and restructuring of the code. 
Makes sense.


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

https://reviews.llvm.org/D129753



More information about the llvm-commits mailing list