It's possible that the mask is already a NOT. At least if InstCombine
hasn't canonicalized the input. In that case we will form an ANDN with
X instead of with Y. So we don't need to worry about Y being a constant.
If M is a bitwise not, we do need to worry about X being a constant so
we handle that case now.
This fixes a size regression found when trying to enable this combine
for RISCV in D113937.