An xor with constant should have equivalent perf as sub-from-constant on any target (or better perf in the case that the sub constant is harder to materialize and use).
This is translated from an existing fold in InstCombine, but the pattern can show up in codegen as shown in a variety of test diffs.
Alive2 proof:
https://alive2.llvm.org/ce/z/8CgggY
This might help remove some diffs from D127115. We don't see test diffs on basic x86 examples because this fold already exists somewhere later in that target's codegen, but that may be too late to combine with other transforms.
This diff was called a code-size regression in D48529.