[SCEV] Prove implicaitons via AddRec start
authorMax Kazantsev <mkazantsev@azul.com>
Thu, 1 Oct 2020 08:58:31 +0000 (15:58 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Thu, 1 Oct 2020 10:09:38 +0000 (17:09 +0700)
commit69acdfe075fa8eb18781f88f4d0cd1ea40fa6e48
tree3f9777a7ded37f490b452e57526b23158c6fb55c
parent38f625d0d1360b035271422bab922d22ed04d79a
[SCEV] Prove implicaitons via AddRec start

If we know that some predicate is true for AddRec and an invariant
(w.r.t. this AddRec's loop), this fact is, in particular, true on the first
iteration. We can try to prove the facts we need using the start value.

The motivating example is proving things like
```
  isImpliedCondOperands(>=, X, 0, {X,+,-1}, 0}
```

Differential Revision: https://reviews.llvm.org/D88208
Reviewed By: reames
llvm/include/llvm/Analysis/ScalarEvolution.h
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/unittests/Analysis/ScalarEvolutionTest.cpp