[RISCV] Add more cmov isel patterns to handle seteq/ne with a small non-zero immediate.
authorCraig Topper <craig.topper@sifive.com>
Fri, 22 Jan 2021 21:53:37 +0000 (13:53 -0800)
committerCraig Topper <craig.topper@sifive.com>
Fri, 22 Jan 2021 22:51:22 +0000 (14:51 -0800)
commitd65e8ee507f82ddca018267d0ce627518dd07337
treed13dd37f5e02aedc87080cea95bb392fba63e9cd
parent6e8ef3b76ab65960edd6ee99f387e75564d8d9db
[RISCV] Add more cmov isel patterns to handle seteq/ne with a small non-zero immediate.

Similar to our free standing setcc patterns, we can use ADDI to
subtract the immediate from the other operand. Then the cmov
can check if the result is zero or non-zero.

Reviewed By: mundaym

Differential Revision: https://reviews.llvm.org/D95169
llvm/lib/Target/RISCV/RISCVInstrInfoB.td
llvm/test/CodeGen/RISCV/select-optimize-multiple.ll