[RISCV] Apply DeMorgan to (beqz (and/or (seteq), (xor Z, 1))) to remove the xor.
We can rewrite to (bnez (or/and (setne), Z) is Z is 0/1. Alternatively, we could canonicalize to (xor (or/and (setne), Z), 1) even if there is no branch. The xor would not always get removed, but it might enable other DeMorgan combines. I decided to be conservative for this first patch and require the xor to be removed. I have a couple other invertible setccs I will add in a follow up patch. Reviewed By: reames Differential Revision: https://reviews.llvm.org/D132771
Loading
Please sign in to comment