[llvm] [RISCV] and x (sub -1, y) -> andn x y (PR #129253)

Gábor Spaits via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 08:29:27 PST 2025


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


More information about the llvm-commits mailing list