SuccessChanges

Summary

  1. [InstCombine] Add additional tests for known non zero (NFC) (details)
  2. [InstCombine] Generalize icmp handling in isKnownNonZero() (details)
Commit b0e6007c8254811a5828c1a253a615e45359c653 by nikita.ppv
[InstCombine] Add additional tests for known non zero (NFC)

Check conditions that imply non-zero, even if they are not literally
"x != 0".

Using ctlz for testing, as explicit comparison might get folded by
other reasoning.
The file was modifiedllvm/test/Transforms/InstCombine/known-non-zero.ll
Commit 35676a4f9a536a2aab768af63ddbb15bc722d7f9 by nikita.ppv
[InstCombine] Generalize icmp handling in isKnownNonZero()

The dominating condition handling in isKnownNonZero() currently
only takes into account conditions of the form "x != 0" or "x == 0".
However, there are plenty of other conditions that imply non-zero,
a common one being "x s> 0".

Peculiarly, the handling for assumes was already dealing with more
general non-zero-ness conditions, so this just reuses the same
logic for the dominating condition case.
The file was modifiedllvm/test/Transforms/Attributor/nonnull.ll
The file was modifiedllvm/test/Transforms/InstCombine/known-non-zero.ll
The file was modifiedllvm/lib/Analysis/ValueTracking.cpp