[AArch64] Use correct calling convention for each vararg
authorPhilippe Valembois <lephilousophe@users.noreply.github.com>
Thu, 10 Mar 2022 23:05:29 +0000 (15:05 -0800)
committerEli Friedman <efriedma@quicinc.com>
Thu, 10 Mar 2022 23:07:25 +0000 (15:07 -0800)
commit26cd258420c774254cc48330b1f4d23d353baf05
tree4502dd06ad033a6121916ccaa136cf6ed5258e24
parentd54c4df31470044a66605ebb8a2f936e8dd552af
[AArch64] Use correct calling convention for each vararg

While checking is tail call optimization is possible, the calling
convention applied to fixed arguments is not the correct one.
This implies for DarwinPCS that all arguments of a vararg function will
go to the stack although fixed ones can go in registers.

This prevents non-virtual thunks to be tail optimized although they are
marked as musttail.

Differential Revision: https://reviews.llvm.org/D120622
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.h
llvm/test/CodeGen/AArch64/darwinpcs-tail.ll [new file with mode: 0644]