Fix bug 22641
authorSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 24 Feb 2015 01:02:42 +0000 (01:02 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 24 Feb 2015 01:02:42 +0000 (01:02 +0000)
commitedf1700d3301b34556bc66660ed503530637be8d
treef2e38e4576be85f81d39bc038116569cf9126845
parentbd26e6a0065dc21fd15eec02497ceb9b962849b5
Fix bug 22641

The bug was a result of getPreStartForExtend interpreting nsw/nuw
flags on an add recurrence more strongly than is legal.  {S,+,X}<nsw>
implies S+X is nsw only if the backedge of the loop is taken at least
once.

NOTE: I had accidentally committed an unrelated change with the commit
message of this change in r230275 (r230275 was reverted in r230279).
This is the correct change for this commit message.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230291 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/infer-prestart-no-wrap.ll
test/Analysis/ScalarEvolution/pr22641.ll [new file with mode: 0644]
test/Analysis/ScalarEvolution/scev-prestart-nowrap.ll