[RISCV] Support and tests for a variety of additional LLVM IR constructs
authorAlex Bradbury <asb@lowrisc.org>
Tue, 21 Nov 2017 08:11:03 +0000 (08:11 +0000)
committerAlex Bradbury <asb@lowrisc.org>
Tue, 21 Nov 2017 08:11:03 +0000 (08:11 +0000)
commitffc435e9c78e61f3ce7213840021300a06a984e7
treeab53e03fa9004deaa7c6b191dc1886c6bbc887fa
parentdca72fc4ea8121413b982c996850b2782d951835
[RISCV] Support and tests for a variety of additional LLVM IR constructs

Previous patches primarily ensured that codegen was possible for the standard
RISC-V instructions. However, there are a number of IR inputs that wouldn't be
appropriately lowered. This patch both adds test cases and supports lowering
for a number of these cases:
* Improved sext/zext/trunc support
* Support for setcc variants that don't map directly to RISC-V instructions
* Lowering mul, and hence support for external symbols
* addc, adde, subc, sube
* mulhs, srem, mulhu, urem, udiv, sdiv
* {srl,sra,shl}_parts
* brind
* br_jt
* bswap, ctlz, cttz, ctpop
* rotl, rotr
* BlockAddress operands

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

llvm-svn: 318737
17 files changed:
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.h
llvm/lib/Target/RISCV/RISCVInstrInfo.td
llvm/lib/Target/RISCV/RISCVMCInstLower.cpp
llvm/test/CodeGen/RISCV/addc-adde-sube-subc.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/alu32.ll
llvm/test/CodeGen/RISCV/blockaddress.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/bswap-ctlz-cttz-ctpop.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/div.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/i32-icmp.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/indirectbr.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/jumptable.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/mul.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rem.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rotl-rotr.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/sext-zext-trunc.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/shifts.ll [new file with mode: 0644]