Fix and improve SCEV ComputeBackedgeTankCount.
authorAndrew Trick <atrick@apple.com>
Fri, 23 May 2014 19:47:13 +0000 (19:47 +0000)
committerAndrew Trick <atrick@apple.com>
Fri, 23 May 2014 19:47:13 +0000 (19:47 +0000)
commitab0d042a74f2e454a516be7a956b091f0ae7e1af
tree14685ef0e158d3e5bc938ac72e66830f92f60cdf
parent8b8e384b3cfe35093829530e1772cd1daac62b74
Fix and improve SCEV ComputeBackedgeTankCount.

This is a follow-up to r209358: PR19799: Indvars miscompile due to an
incorrect max backedge taken count from SCEV.

That fix was incomplete as pointed out by Arnold and Michael Z. The
code was also too confusing. It needed a careful rewrite with more
unit tests. This version will also happen to optimize more cases.

<rdar://17005101> PR19799: Indvars miscompile...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209545 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/max-trip-count.ll