[RISCV] Add isel patterns for ineg+setge/le/uge/ule.
setge/le/uge/ule selected by themselves require an xori with 1. If we're negating the setcc, we can fold the xori with the neg to create an addi with -1. This works because xori X, 1 is equivalent to 1 - X if X is either 0 or 1. So we're doing -(1 - X) which is X-1 or X+-1. This improves the code for selecting between 0 and -1 based on a condition for some conditions. Reviewed By: asb Differential Revision: https://reviews.llvm.org/D129957
Loading
Please sign in to comment