This is a possible solution for the remainder of PR35875. The idea is that if
we have a SETCC of two ANDs with the same mask, and we can calculate
that the non-mask bits of the operands of the AND are the same, we can
drop the ANDs from the SETCC.
i.e (x&C < y&C) => x<y for any s/u </>/=/etc.
Here is an attempt to prove such a thing at the IR level:
https://rise4fun.com/Alive/ha2
So that seems to be fine. Except that the code in question, the ANDs come
from type legalising a SETCC node, with values that come from anyext loads.
These don't provide upper known bits, even though they are likely to become
zext loads.
Hence all this plumbing to find and return anyext loads, treating them as
zeroext loads during computeKnownBits and adjusting the loads to zeroext
if that is useful for this case.
The left hand side of these tests are not yet checked in. As you can hopefully
see, it helps out quite a bit here. If there are better ways to solve this
problem, I'm all ears.
If you reorder the default parameters, you could reduce the number of changes needed in the backends.