OSDN Git Service

[RISCV] Implement lowering of ISD::SELECT
authorAlex Bradbury <asb@lowrisc.org>
Tue, 21 Nov 2017 07:51:32 +0000 (07:51 +0000)
committerAlex Bradbury <asb@lowrisc.org>
Tue, 21 Nov 2017 07:51:32 +0000 (07:51 +0000)
commitfbdb03fa563117e46f789f30a043fcf5197ad14a
tree34fde1cddece674a2b2d1e3570e2cc35f954b1ea
parentc9e07ab99471e58c82ad718071d688d54680d92f
[RISCV] Implement lowering of ISD::SELECT

Although ISD::SELECT_CC is a more natural match for RISCVISD::SELECT_CC (and
ultimately the integer RISC-V conditional branch instructions), we choose to
expand ISD::SELECT_CC and lower ISD::SELECT. The appropriate compare+branch
will be created in the case where an ISD::SELECT condition value is created by
an ISD::SETCC node, which operates on XLen types. Other datatypes such as
floating point don't have conditional branch instructions, and lowering
ISD::SELECT allows more flexibility for handling these cases.

Differential Revision: https://reviews.llvm.org/D29937

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318735 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/RISCV/RISCVISelLowering.cpp
lib/Target/RISCV/RISCVISelLowering.h
lib/Target/RISCV/RISCVInstrInfo.td
test/CodeGen/RISCV/bare-select.ll [new file with mode: 0644]
test/CodeGen/RISCV/select-cc.ll [new file with mode: 0644]