[llvm] [AArch64] Skip over shadow space for ARM64EC entry thunk variadic calls (PR #80994)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 12:32:09 PST 2024


efriedma-quic wrote:

> but I don't think it makes much sense to break the 1-1 mapping between x86 args and entry thunk args, modelling x4 as an argument when it isn't. Using the regular CC to call a varargs CC call also feels quite counter-intuitive.

AArch64Arm64ECCallLowering::getThunkArgTypes already completely throws away the type of varargs functions.  Doing further rewrites doesn't seem like it's making anything worse.

> The former seems like a better idea, but modelling both zeroing x5 and offsetting x4 in a generic way seems like it would need something beyond just basic forwarding. Did you have any concrete ideas for handling that?

I guess you'd make the argument list completely empty (except for sret), mark the call with a "thunk" attribute like we do for musttail varargs forwarding, then check for the "thunk" marking in isel and add the arguments.  I don't really like introducing a whole new kind of varargs forwarding just for this one case, though.

https://github.com/llvm/llvm-project/pull/80994


More information about the llvm-commits mailing list