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)
commitb14010d28bc7b9c8d2457abb1c90ec7e7f1fa99b
tree8d5aeb0b8c547b776293142b42feb5c6152ebc86
parent6487ce955a0227f24a0958997ca4785e6b343734
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

llvm-svn: 230291
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/infer-prestart-no-wrap.ll
llvm/test/Analysis/ScalarEvolution/pr22641.ll [new file with mode: 0644]
llvm/test/Analysis/ScalarEvolution/scev-prestart-nowrap.ll