[RISCV] Add isel pattern for (setne/eq GPR, -2048)
authorCraig Topper <craig.topper@sifive.com>
Fri, 29 Jul 2022 21:01:14 +0000 (14:01 -0700)
committerCraig Topper <craig.topper@sifive.com>
Fri, 29 Jul 2022 21:07:38 +0000 (14:07 -0700)
commite637feee80f94d23950d25673b6c2e0d46d335a9
tree3d42908982874c45efe02801e49ff734e2d43be8
parentb0f18af30ba71382feda64fe523baac151d9a43f
[RISCV] Add isel pattern for (setne/eq GPR, -2048)

For constants in the range [-2047, 2048] we use addi. If the constant
is -2048 we can use xori. If we don't match this explicitly, we'll
emit an LI for the -2048 followed by an XOR.
llvm/lib/Target/RISCV/RISCVInstrInfo.td
llvm/test/CodeGen/RISCV/i32-icmp.ll
llvm/test/CodeGen/RISCV/i64-icmp.ll