[RISCV] Fix stack slot for argument types (Bug 49500)
authorFraser Cormack <fraser@codeplay.com>
Mon, 22 Mar 2021 15:54:04 +0000 (15:54 +0000)
committerFraser Cormack <fraser@codeplay.com>
Thu, 29 Apr 2021 08:10:48 +0000 (09:10 +0100)
commit43ad058a01881962604a941ae95209fad095aa18
tree2fe4b611dde987a92da41f9e223368619c961302
parenteb56fa97de96856bb63e31340598a356056470c5
[RISCV] Fix stack slot for argument types (Bug 49500)

This is an complementary/alternative fix for D99068. It takes a slightly
different approach by explicitly summing up all of the required split
part type sizes and ensuring we allocate enough space for them. It also
takes the maximum alignment of each part.

Compared with D99068 there are fewer changes to the stack objects in
existing tests. However, @luismarques has shown in that patch that there
are opportunities to reduce our stack usage in the future.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D99087
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-calling-conv.ll
llvm/test/CodeGen/RISCV/stack-slot-size.ll
llvm/test/CodeGen/RISCV/vector-abi.ll