Sanjoy Das 8d16a81c33 Bugfix: SCEVExpander incorrectly marks increment operations as no-wrap
When emitting the increment operation, SCEVExpander marks the
operation as nuw or nsw based on the flags on the preincrement SCEV.
This is incorrect because, for instance, it is possible that {-6,+,1}
is <nuw> while {-6,+,1}+1 = {-5,+,1} is not.

This change teaches SCEV to mark the increment as nuw/nsw only if it
can explicitly prove that the increment operation won't overflow.

Apart from the attached test case, another (more realistic) manifestation
of the bug can be seen in Transforms/IndVarSimplify/pr20680.ll.

NOTE: this change was landed with an incorrect commit message in
rL230275 and was reverted for that reason in rL230279.  This commit
message is the correct one.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230280 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 23:22:58 +00:00
..
2015-01-14 22:27:36 +00:00
2015-02-03 20:37:08 +00:00
2015-02-18 08:09:28 +00:00
2015-01-14 22:27:36 +00:00
2015-02-18 19:32:25 +00:00
2015-01-14 22:27:36 +00:00
2015-02-20 18:56:14 +00:00
2015-01-14 22:27:36 +00:00
2015-01-14 22:27:36 +00:00