[AIX] Allow vararg calls when all arguments reside in registers
authorjasonliu <jasonliu.development@gmail.com>
Fri, 10 Jan 2020 16:15:46 +0000 (16:15 +0000)
committerjasonliu <jasonliu.development@gmail.com>
Fri, 10 Jan 2020 17:33:35 +0000 (17:33 +0000)
commitdfed052fb3ecef53bf01612ec3fc7df73c2134b7
treee00408a83c6be76318d52801689777815df5ef8f
parentff92e469caefff9f86e5e812c08b9bba582be5d3
[AIX] Allow vararg calls when all arguments reside in registers

Summary:
This patch pushes the AIX vararg unimplemented error diagnostic later
and allows vararg calls so long as all the arguments can be passed in register.
This patch extends the AIX calling convention implementation to initialize
GPR(s) for vararg float arguments. On AIX, both GPR(s) and FPR are allocated
for floating point arguments. The GPR(s) are only initialized for vararg calls,
otherwise the callee is expected to retrieve the float argument in the FPR.

f64 in AIX PPC32 requires special handling in order to allocated and
initialize 2 GPRs. This is performed with bitcast, SRL, truncation to
initialize one GPR for the MSW and bitcast, truncations to initialize
the other GPR for the LSW.

A future patch will follow to add support for arguments passed on the stack.

Patch provided by: cebowleratibm

Reviewers: sfertile, ZarkoCA, hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D71013
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/aix-cc-abi.ll [moved from llvm/test/CodeGen/PowerPC/aix_cc_abi.ll with 64% similarity]
llvm/test/CodeGen/PowerPC/aix-cc-altivec.ll [new file with mode: 0644]