[SCEV] Generalize no-self-wrap check in isLoopInvariantExitCondDuringFirstIterations
authorMax Kazantsev <mkazantsev@azul.com>
Wed, 11 Nov 2020 04:17:13 +0000 (11:17 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Wed, 11 Nov 2020 04:17:13 +0000 (11:17 +0700)
commit7dcc8899174f44b7447bc48a9f2ff27f5458f8b7
tree4046970e2e2379f0c1660dcd80d4b68ec4387aa4
parentb7067480d2ea528fb49dc39cc6b1feb2761128e4
[SCEV] Generalize no-self-wrap check in isLoopInvariantExitCondDuringFirstIterations

Lift limitation on step being `+/- 1`. In fact, the only thing it is needed for
is proving no-self-wrap. We can instead check this flag directly.

Theoretically it can increase the scope of the transform, but I could not
construct such test easily.

Differential Revision: https://reviews.llvm.org/D91126
Reviewed By: apilipenko
llvm/lib/Analysis/ScalarEvolution.cpp