[RISCV][GlobalISel] Add lowerFormalArguments for calling convention
authorNitin John Raj <nitin.raj@sifive.com>
Tue, 30 May 2023 19:54:24 +0000 (12:54 -0700)
committerNitin John Raj <nitin.raj@sifive.com>
Tue, 30 May 2023 20:42:49 +0000 (13:42 -0700)
commitaf8e3861025f3c931cc67ced86d6bd8c939e6fc0
tree73c4dedf6c40380205f004ead234e836d254a4f1
parentf46638b01d1bd66aa879188132e0d19a0a7f5928
[RISCV][GlobalISel] Add lowerFormalArguments for calling convention

This patch adds an IncomingValueHandler and IncomingValueAssigner, and implements minimal support for lowering formal arguments according to the RISC-V calling convention. Simple non-aggregate integer and pointer types are supported.

In the future, we must correctly handle byval and sret pointer arguments, and instances where the number of arguments exceeds the number of registers.

Coauthored By: lewis-revill

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D74977
llvm/lib/Target/RISCV/GISel/RISCVCallLowering.cpp
llvm/test/CodeGen/RISCV/GlobalISel/irtranslator/args.ll [new file with mode: 0644]