[RISCV] Support vector SET[U]LT and SET[U]GE with splatted immediates
authorFraser Cormack <fraser@codeplay.com>
Thu, 8 Apr 2021 10:22:46 +0000 (11:22 +0100)
committerFraser Cormack <fraser@codeplay.com>
Mon, 12 Apr 2021 17:36:45 +0000 (18:36 +0100)
commitd737c47137368ffe8e2c2ccee94a992f04369bed
tree2ab6409e5b5d287e4163eb060af796c2964fa363
parent7f9e36b209ddfc9bf08934ed911c9c5cb459a0b9
[RISCV] Support vector SET[U]LT and SET[U]GE with splatted immediates

This patch adds more optimized codegen for the above SETCC forms,
by matching the '.vi' vector forms when the immediate is a 5-bit signed
immediate plus 1. The immediate can be decremented and the corresponding
SET[U]LE or SET[U]GT forms can be matched.

This work was left as a TODO from D94168.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D100096
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-setcc.ll
llvm/test/CodeGen/RISCV/rvv/saddo-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/setcc-integer-rv32.ll
llvm/test/CodeGen/RISCV/rvv/setcc-integer-rv64.ll