Re-apply r251050 with a for PR25421
authorSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 5 Nov 2015 23:45:38 +0000 (23:45 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 5 Nov 2015 23:45:38 +0000 (23:45 +0000)
commitedb273f9aec8b66e13b2530c3878c85688cf6229
treed849f7095fd95e29ee0dd4beb11bb065d274a359
parent59970e6f528230b1d97a95facc5c4a281dcc2535
Re-apply r251050 with a for PR25421

The bug: I missed adding break statements in the switch / case.

Original commit message:

[SCEV] Teach SCEV some axioms about non-wrapping arithmetic

Summary:
 - A s<  (A + C)<nsw> if C >  0
 - A s<= (A + C)<nsw> if C >= 0
 - (A + C)<nsw> s<  A if C <  0
 - (A + C)<nsw> s<= A if C <= 0

Right now `C` needs to be a constant, but we can later generalize it to
be a non-constant if needed.

Reviewers: atrick, hfinkel, reames, nlewycky

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252236 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ScalarEvolution.h
lib/Analysis/ScalarEvolution.cpp
test/Transforms/IndVarSimplify/eliminate-comparison.ll
test/Transforms/IndVarSimplify/pr25421.ll [new file with mode: 0644]