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)
commit839e30b2c07347b1538587693e7ed014c345b74b
tree9f30af90b707492ad5506d48b6b777ebcd973a4e
parentfe2413692f5f1247053ab1ec9cac0be48feb3572
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...

llvm-svn: 209545
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/max-trip-count.ll