[SCEV] Infer no-self-wrap via constant ranges
authorPhilip Reames <preames@rivosinc.com>
Wed, 22 Mar 2023 16:51:58 +0000 (09:51 -0700)
committerPhilip Reames <listmail@philipreames.com>
Wed, 22 Mar 2023 19:06:28 +0000 (12:06 -0700)
commit6afcc54ac7d68fa2b28f0e7cbf9dc1d4ac7fb95e
tree4f4019faab6f912bf36e1e1fc8f0c39800e56506
parent7e5c48b8bd9ff0ee5de3ba28c833f1225f14e44d
[SCEV] Infer no-self-wrap via constant ranges

Without this, pointer IVs in loops with small constant trip counts couldn't be proven no-self-wrap. This came up in a new LSR transform, but may also benefit other SCEV consumers as well.

Differential Revision: https://reviews.llvm.org/D146596
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
llvm/test/Analysis/ScalarEvolution/different-loops-recs.ll
llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll
llvm/test/Transforms/LoopRotate/pr51981-scev-problem.ll
llvm/test/Transforms/LoopVersioning/lcssa.ll