[SCEV] Fix PR25369
authorSanjoy Das <sanjoy@playingwithpointers.com>
Mon, 2 Nov 2015 02:06:01 +0000 (02:06 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Mon, 2 Nov 2015 02:06:01 +0000 (02:06 +0000)
commit15465ea1a2de1290e7a4f695a5d57039f7c76796
tree9f9583f2345a64b723ecc4659c585428c2e235b4
parentd40a89865168a41e172cd9ea5054016267f712fc
[SCEV] Fix PR25369

Have `getConstantEvolutionLoopExitValue` work correctly with multiple
entry loops.

As far as I can tell, `getConstantEvolutionLoopExitValue` never did the
right thing for multiple entry loops; and before r249712 it would
silently return an incorrect answer.  r249712 changed SCEV to fail an
assert on a multiple entry loop, and this change fixes the underlying
issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251770 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/pr25369.ll [new file with mode: 0644]