[PowerPC] Implement 64-bit ELFv2 Calling Convention in TableGen (for integers/floats...
authorAmy Kwan <amy.kwan1@ibm.com>
Sun, 26 Mar 2023 04:03:10 +0000 (23:03 -0500)
committerAmy Kwan <amy.kwan1@ibm.com>
Mon, 27 Mar 2023 13:23:04 +0000 (08:23 -0500)
commit6126356d829be32e2195b8ddf8b908ab417ff7f5
tree3a923c24e86d22d3daf2bc3e62ebff12ee6df077
parent03df67e7858ef56910f6c08a95c7156ae00ef984
[PowerPC] Implement 64-bit ELFv2 Calling Convention in TableGen (for integers/floats/vectors in registers)

This patch partially implements the parameter passing rules outlined in the
ELFv2 ABI within TableGen. Specifically, it implements the parameter assignment
of integers, floats, and vectors within registers - where the GPR numbering will
be "skipped" depending on the ordering of floats and vectors that appear within
a parameter list.

As we begin to adopt GlobalISel to the PowerPC backend, there is a need for a
TableGen definition that encapsulates the ELFv2 parameter passing rules. Thus,
this patch also changes the default calling convention that is returned within
the ccAssignFnForCall() function used in our GlobalISel implementation, and also
adds some additional testing of the calling convention that is implemented.

Future patches that build on top of this initial TableGen definition will aim to
add more of the ABI complexities, including support for additional types and
also in-memory arguments.

Differential Revision: https://reviews.llvm.org/D137504
llvm/lib/Target/PowerPC/PPCCallingConv.cpp
llvm/lib/Target/PowerPC/PPCCallingConv.h
llvm/lib/Target/PowerPC/PPCCallingConv.td
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/GlobalISel/irtranslator-args-lowering-fp128.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/GlobalISel/irtranslator-args-lowering-mixed-types.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/GlobalISel/irtranslator-args-lowering-scalar.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/GlobalISel/irtranslator-args-lowering-vectors.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/GlobalISel/irtranslator-args-lowering.ll