SuccessChanges

Summary

  1. [LVI] Refactor getValueFromICmpCondition (NFC) (details)
  2. [CVP] Add tests for mask comparisons (NFC) (details)
  3. [LVI] Get value range from mask comparison (details)
Commit f94bbe19b6f6086ff94b1eb4ef0bc5802752bfe1 by nikita.ppv
[LVI] Refactor getValueFromICmpCondition (NFC)

Rewrite this in a way where the core logic is in a separate
function, that is invoked with swapped operands. This makes it
easier to add handling for additional icmp patterns.
The file was modifiedllvm/lib/Analysis/LazyValueInfo.cpp (diff)
Commit 91af6a78d00f731826ff2eb81c9a9281b1d21388 by nikita.ppv
[CVP] Add tests for mask comparisons (NFC)
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/icmp.ll (diff)
Commit 445db89b537e5397a2d4b08e79751edb845b2c2a by nikita.ppv
[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.
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/icmp.ll (diff)
The file was modifiedllvm/lib/Analysis/LazyValueInfo.cpp (diff)