spaits wrote: > Isn't sub -1, x canonicalized to xor x, -1? Furthermore, if the InstCombiner sees the `xor` version it will replace it with `sub`. See https://godbolt.org/z/4ffxhPbz6 Maybe we shall make it back to sub in SelDAG? https://github.com/llvm/llvm-project/pull/129253