[LVI] Exploit nsw/nuw when computing constant ranges
authorPhilip Reames <listmail@philipreames.com>
Fri, 12 Feb 2016 19:05:16 +0000 (19:05 +0000)
committerPhilip Reames <listmail@philipreames.com>
Fri, 12 Feb 2016 19:05:16 +0000 (19:05 +0000)
commit2b9100dfbd4219727c6904e76403efda0d2d5e63
treea07c77238f9e6b6fe6c1d79e867ae81aa49a0b76
parentf6892eda24f1666c9dbd64bdff0994b04554c681
[LVI] Exploit nsw/nuw when computing constant ranges

As the title says. Modelled after similar code in SCEV.

This is useful when analysing induction variables in loops which have been canonicalized by other passes. I wrote the tests as non-loops specifically to avoid the generality introduced in http://reviews.llvm.org/D17174. While that can handle many induction variables without *needing* to exploit nsw, there's no reason not to use it if we've already proven it.

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

llvm-svn: 260705
llvm/lib/Analysis/LazyValueInfo.cpp
llvm/test/Transforms/CorrelatedValuePropagation/basic.ll