[ValueTracking] Teach isKnownNonZero about monotonically increasing PHIs
authorJames Molloy <james.molloy@arm.com>
Tue, 29 Sep 2015 14:08:45 +0000 (14:08 +0000)
committerJames Molloy <james.molloy@arm.com>
Tue, 29 Sep 2015 14:08:45 +0000 (14:08 +0000)
commit79c45a39542b9d62811482b9cc96d7f4429f7d15
tree3d4d5e6dbb19487c69313c10a2cd428aa45d1ae4
parentf5f9e9a3bfa0c7142b7be5027355ffa819b94ac6
[ValueTracking] Teach isKnownNonZero about monotonically increasing PHIs

If a PHI starts at a non-negative constant, monotonically increases
(only adds of a constant are supported at the moment) and that add
does not wrap, then the PHI is known never to be zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248796 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ValueTracking.cpp
test/Analysis/ValueTracking/monotonic-phi.ll [new file with mode: 0644]