This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Recognize `(icmp eq/ne (and X, ~Mask), 0)` pattern in `foldICmpWithLowBitMaskedVal`
AbandonedPublic

Authored by goldstein.w.n on Aug 31 2023, 6:30 PM.

Details

Reviewers
nikic
RKSimon
Summary

(icmp eq/ne (and X, ~Mask), 0) is equivilent to `(icmp eq/ne (and X,
Mask), X` and we sometimes generate the former pattern intentionally
to reduce number of uses of X.
Proof: https://alive2.llvm.org/ce/z/3u-usC

Diff Detail