Add a utility function that detects whether a loop is guaranteed to be finite.
authorNick Lewycky <nicholas@mxc.ca>
Tue, 18 Nov 2008 15:10:54 +0000 (15:10 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Tue, 18 Nov 2008 15:10:54 +0000 (15:10 +0000)
commitdd643f26c43d162e905a07bf0826680aa10f7161
tree6250d940d0206fd446630ab36212fdf38e50a083
parent5734450d40fe5546eb98c0d856d73c3321eaf5d2
Add a utility function that detects whether a loop is guaranteed to be finite.

Use it to safely handle less-than-or-equals-to exit conditions in loops. These
also occur when the loop exit branch is exit on true because SCEV inverses the
icmp predicate.

Use it again to handle non-zero strides, but only with an unsigned comparison
in the exit condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59528 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/2008-11-18-LessThanOrEqual.ll [new file with mode: 0644]
test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll [new file with mode: 0644]
test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll [new file with mode: 0644]