[RISCV] Support vector types in combination with fastcc
authorFraser Cormack <fraser@codeplay.com>
Thu, 13 May 2021 16:34:41 +0000 (17:34 +0100)
committerFraser Cormack <fraser@codeplay.com>
Tue, 1 Jun 2021 09:31:18 +0000 (10:31 +0100)
commit4f500c402b7357808d9595313438f223447dcace
treea4c0f5e19ccfcce248d86411948aa67d42c4492c
parent82f92e35c6464e23859c29422956caaceb623967
[RISCV] Support vector types in combination with fastcc

This patch extends the RISC-V lowering of the 'fastcc' calling
convention to vector types, both fixed-length and scalable. Without this
patch, any function passing or returning vector types by value would
throw a compiler error.

Vectors are handled in 'fastcc' much as they are in the default calling
convention, the noticeable difference being the extended set of scalar
GPR registers that can be used to pass vectors indirectly.

Reviewed By: HsiangKai

Differential Revision: https://reviews.llvm.org/D102505
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.h
llvm/test/CodeGen/RISCV/rvv/calling-conv-fastcc.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-calling-conv-fastcc.ll [new file with mode: 0644]