[SCEV] Reapply 'Teach isLoopBackedgeGuardedByCond to exploit trip counts'
authorSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 25 Sep 2015 23:53:50 +0000 (23:53 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 25 Sep 2015 23:53:50 +0000 (23:53 +0000)
commitfe14a332e4dfe559ea7dab9862579e455ef8b940
tree4552c313a7f303d598487ea9712fc94fc3278989
parentf0841dc6483dbba0585f2b21dbd98b7eb33b8ed7
[SCEV] Reapply 'Teach isLoopBackedgeGuardedByCond to exploit trip counts'

Summary:
If the trip count of a specific backedge is `N`, then we know that
backedge is effectively guarded by the condition `{0,+,1} u< N`.  This
change teaches SCEV to use this condition to prove things in
`isLoopBackedgeGuardedByCond`.

Depends on D12948
Depends on D12949

The original checkin, r248608 had to be backed out due to an issue with
a ObjCXX unit test.  That issue is now fixed, so re-landing.

Reviewers: atrick, reames, majnemer, hfinkel

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D12950

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248638 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/zext-wrap.ll
test/Transforms/IndVarSimplify/eliminate-comparison.ll