[PATCH] D145510: [SCEV] Fix finite loop non-strict predicate simplification (PR60944)

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 21:48:57 PST 2023


StephenFan added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:9172
+      break;
+    RHS = getAddExpr(getOne(RHS->getType()), RHS);
+    [[fallthrough]];
----------------
mkazantsev wrote:
> Can this overflow?
Yes, it can. Although it can't overflow in loop `L`, it still may overflow somewhere out of the loop. See test file `pr60944.ll` below.
In `loop2`, `%iv + 1` can not overflow as a result of `mustprogress` attribute, but `%iv + 1` can still overflow in `loop`.


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

https://reviews.llvm.org/D145510



More information about the llvm-commits mailing list