This is a cut down version of what SimplifyMultipleUseDemandedBits tries to - if the RHS is a constant mask then see if the LHS known bits means that result bits are all known.
I wasn't sure how much we should be calling computeKnownBits in a lighter pass such as InstSimplify so I didn't generalise this to call computeKnownBits for a non-constant RHS as well, but we could very easily in the future, we could even consider moving InstCombinerImpl::SimplifyMultipleUseDemandedBits into InstSimplify?
Noticed as @spatel wondered if extending D131838 test coverage would be easier in InstSimplify