[RISCV] Add a DAG combine for (czero_eq X, (xor Y, 1)) -> (czero_ne X, Y) if Y is...
authorCraig Topper <craig.topper@sifive.com>
Wed, 19 Jul 2023 19:33:08 +0000 (12:33 -0700)
committerCraig Topper <craig.topper@sifive.com>
Wed, 19 Jul 2023 19:33:08 +0000 (12:33 -0700)
commit7dfe62327db81cc5ee3e29a994818370d95dc9e3
tree59485580539feafa0312479dad9d9d99468bc4d0
parent2efe88b50e8c96c53dbe41bcb907cc368a1fb0d7
[RISCV] Add a DAG combine for (czero_eq X, (xor Y, 1)) -> (czero_ne X, Y) if Y is 0 or 1.

This is an alternative to D155288 that can handle other sources of
xori like FP compares. Unfortunately, it misses the i64 setge case
on RV32 in condops.ll.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D155328
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/condops.ll