]> granicus.if.org Git - llvm/commit
[SCEV] Teach SCEV to find maxBECount when loop endbound is variant
authorAnna Thomas <anna@azul.com>
Fri, 13 Oct 2017 14:30:43 +0000 (14:30 +0000)
committerAnna Thomas <anna@azul.com>
Fri, 13 Oct 2017 14:30:43 +0000 (14:30 +0000)
commit7f1eb15289a88b96bfd104a899344ece3fbe2346
tree8af3b644accd13dcd62ba78bec70945ee077c978
parent138989f0161998dc4d850f3d1e78ec13d49692ff
[SCEV] Teach SCEV to find maxBECount when loop endbound is variant

Summary:
This patch teaches SCEV to calculate the maxBECount when the end bound
of the loop can vary. Note that we cannot calculate the exactBECount.

This will only be done when both conditions are satisfied:
1. the loop termination condition is strictly LT.
2. the IV is proven to not overflow.

This provides more information to users of SCEV and can be used to
improve identification of finite loops.

Reviewers: sanjoy, mkazantsev, silviu.baranga, atrick

Reviewed by: mkazantsev

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315683 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ScalarEvolution.h
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/max-trip-count.ll
test/Transforms/LoopSimplify/preserve-scev.ll