This folds a not (an xor -1) though a predicate_cast, so that it can be turned into a VPNOT and potentially be folded away as an "else" predicate inside a VPT block.
VPT predicates are only 16 bits wide, so I think we could legally apply this to any constant XOR that has the bottom 16 bits set, not just 0xFFFFFFFF.
In case somebody wrote out pred ^ 0xFFFF longhand in source code, would it be better to do that?
Thanks for taking a look. Long story short, the rest of llvm will like to convert xor i32 x, 0xffff to xor i32 x, -1 as it represents a not and is simpler to deal with. Because we tell it that the demanded bits of a PRED_CAST are the lower bits, it will do that transform for us and here we only need to check for a full mask.
There is a isBitwiseNot helper function though, which will do this for us. I'll change it to use that and add an extra test.