OSDN Git Service

[RISCV] Add pseudo instruction for calls with explicit register
authorLewis Revill <lewis.revill@embecosm.com>
Wed, 26 Jun 2019 10:35:58 +0000 (10:35 +0000)
committerLewis Revill <lewis.revill@embecosm.com>
Wed, 26 Jun 2019 10:35:58 +0000 (10:35 +0000)
commitf5bddce9ea82dd8692a94a182e9d53bff3dff065
treed043107189c3de55934668393a344359f3a0e765
parentd00ce88b4bebece908f6626235a3efd4b200094d
[RISCV] Add pseudo instruction for calls with explicit register

This patch adds the PseudoCALLReg instruction which allows using an
explicit register operand as the destination for the return address.

GCC can successfully parse this form of the call instruction, which
would be used for calls to functions which do not use ra as the return
address register, such as the __riscv_save libcalls. This patch forms
the first part of an implementation of -msave-restore for RISC-V.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364403 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
lib/Target/RISCV/RISCVInstrInfo.cpp
lib/Target/RISCV/RISCVInstrInfo.td
test/MC/RISCV/function-call-invalid.s
test/MC/RISCV/function-call.s