[LVI] Get value range from mask comparison
authorNikita Popov <nikita.ppv@gmail.com>
Sun, 20 Sep 2020 19:07:52 +0000 (21:07 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Sun, 20 Sep 2020 19:13:57 +0000 (21:13 +0200)
commit445db89b537e5397a2d4b08e79751edb845b2c2a
tree2dd8bb5a04d7774d160bdf15a35b81a2898134f2
parent91af6a78d00f731826ff2eb81c9a9281b1d21388
[LVI] Get value range from mask comparison

InstCombine likes to canonicalize comparisons of the form
X == C || X == C+1 into (X & -2) == C'. Make sure LVI can still
recover the value range from this. Can of course also be useful
for proper mask comparisons.

For the sake of clarity, the implementation goes through KnownBits
to compute the range.
llvm/lib/Analysis/LazyValueInfo.cpp
llvm/test/Transforms/CorrelatedValuePropagation/icmp.ll