[InstCombine] Refactor and/or of icmp with constant (NFCI)
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 6 Nov 2021 21:15:26 +0000 (22:15 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 9 Nov 2021 20:05:46 +0000 (21:05 +0100)
commitbb12dededeb6558ddd352b40268692041e0fa02c
treeb68295b6d460c786c16222d40a2d0c1d7ed45708
parent8d499bd5bc1eee4c385b2bda26fc5f415a621207
[InstCombine] Refactor and/or of icmp with constant (NFCI)

Rather than testing for many specific combinations of predicates
and values, compute the exact icmp regions for both comparisons
and check whether they union/intersect exactly. If they do,
construct the equivalent icmp for the new range. Assuming that the
existing code handled all possible cases, this should be NFC.

Differential Revision: https://reviews.llvm.org/D113367
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp