[PATCH] D154069: [IRCE] Parse range checks in the form of "LHS - RHS vs Limit"

Aleksandr Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 7 02:31:05 PDT 2023


aleksandr.popov marked 2 inline comments as done.
aleksandr.popov added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:474
+  if (Pred == ICmpInst::ICMP_SLT || Pred == ICmpInst::ICMP_SLE) {
+    // "Expr <= Limit" -> "Expr < Limit + 1"
+    if (Pred == ICmpInst::ICMP_SLE && Limit)
----------------
skatkov wrote:
> what if you did not scale and Limit == S_INT_MAX? Limit + 1 will overflow then?
Then we will scale Limit + 1, if we can't prove that if doesn't overflow


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

https://reviews.llvm.org/D154069



More information about the llvm-commits mailing list