Hmm, it isn't necessary to restrict this optimization AFAICS.  We have
just two cases.

(~X & Y) -> X < Y
(X & ~Y) -> Y < X
(~X | Y) -> X <= Y
(X | ~Y) -> Y <= X

is true for unsigned 1-bit types.

For signed 1-bit types we need to invert logic here as following:

(~X & Y) -> X > Y
(X & ~Y) -> Y > X
(~X | Y) -> X >= Y
(X | ~Y) -> Y >= X

Btw there is one optimization in this context which might be something
worth here too.
-X -> X for 1-bit typed X (signed doesn't matter here).

Kai

Reply via email to