[RLEV] Rewrite loop exit values for multiple exit loops w/o overall loop exit count
authorPhilip Reames <listmail@philipreames.com>
Wed, 14 Aug 2019 18:27:57 +0000 (18:27 +0000)
committerPhilip Reames <listmail@philipreames.com>
Wed, 14 Aug 2019 18:27:57 +0000 (18:27 +0000)
commit6cca3ad43e6df866ec38708f2e20331a59d275b6
treea9a4445f41220252b54c16838bbdd3a42045f9cf
parenta8e070366a4df0106a743383616b9194bd129760
[RLEV] Rewrite loop exit values for multiple exit loops w/o overall loop exit count

We already supported rewriting loop exit values for multiple exit loops, but if any of the loop exits were not computable, we gave up on all loop exit values. This patch generalizes the existing code to handle individual computable loop exits where possible.

As discussed in the review, this is a starting point for figuring out a better API.  The code is a bit ugly, but getting it in lets us test as we go.

Differential Revision: https://reviews.llvm.org/D65544

llvm-svn: 368898
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/test/Transforms/IndVarSimplify/rlev-add-me.ll [new file with mode: 0644]
llvm/test/Transforms/LoopUnroll/scevunroll.ll