[InstCombine] reduce icmp_eq0-of-and-of-select-of-constants
authorSanjay Patel <spatel@rotateright.com>
Mon, 30 Jan 2023 20:34:29 +0000 (15:34 -0500)
committerSanjay Patel <spatel@rotateright.com>
Mon, 30 Jan 2023 21:17:15 +0000 (16:17 -0500)
commit98855059674cf1b6b415f8c543f2a923771fed27
tree797be5379c527a0ff30d3c7fac436fcb1b8043df
parente1cebe9ed12a46282fb6cc9fa9e172b04e5474ef
[InstCombine] reduce icmp_eq0-of-and-of-select-of-constants

This is the most basic patch to handle fixing issue #57666.

D133919 proposes to handle much more than this in a single patch,
but I've used 10 regression tests just to make sure this part is
doing what I expected and nothing more, and it already shows even
more potential TODO items.

The more general proofs from D133919 are correct, but I want to
enable this in smaller steps to reduce risk:
https://alive2.llvm.org/ce/z/RrVEyX

Differential Revision: https://reviews.llvm.org/D142847
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp-select.ll