[SCEV] Exploit A < B => (A+K) < (B+K) when possible
authorSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 25 Sep 2015 19:59:49 +0000 (19:59 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 25 Sep 2015 19:59:49 +0000 (19:59 +0000)
commitdab86b5a2b8c33e769f38b1fa209ebe4c4ccab84
tree4a6d0469655f540842ed8ff676723f80ff8471b7
parentb10f8d4469016fdaa02471b30015908f42ff0268
[SCEV] Exploit A < B => (A+K) < (B+K) when possible

Summary:

This change teaches SCEV's `isImpliedCond` two new identities:

  A u< B u< -C          =>  (A + C) u< (B + C)
  A s< B s< INT_MIN - C =>  (A + C) s< (B + C)

While these are useful on their own, they're really intended to support
D12950.

Reviewers: atrick, reames, majnemer, nlewycky, hfinkel

Subscribers: aadg, sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248606 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ScalarEvolution.h
lib/Analysis/ScalarEvolution.cpp
test/Transforms/IndVarSimplify/eliminate-comparison.ll